I don't know how to enter a password while connecting to the gRPC server

Viewed 22
        public async Task<string> echo()
        {
            using var httpClientHandler = new HttpClientHandler
            {
                ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
            };

            // The port number must match the port of the gRPC server.
            using var httpClient = new HttpClient(httpClientHandler);
            using var channel = GrpcChannel.ForAddress("http://10.0.50.120:30000", new GrpcChannelOptions { HttpClient = httpClient });

            var client = new StorageService.StorageServiceClient(channel);

            var reply = await client.echoAsync(new EchoRequest { });

            return reply.ServiceName;

        }

I made a client with blazer and I want to communicate with other servers through echo. However, an exception has occurred. "The connection failed because the target computer refused to connect. " I thought it was not possible because of the authentication of entering the ID and password of the server. I want to know if that's the right problem and if it is, I want to know how to enter it with code.

0 Answers
Related