• 周五. 9月 30th, 2022

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

.netcore grpc The SSL connection could not be established,

admin

11月 28, 2021

添加允许不授信的证书或者无效的证书

 // 1、建立连接
var httpClientHandler = new HttpClientHandler();
// Return `true` to allow certificates that are untrusted/invalid
httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
var httpClient = new HttpClient(httpClientHandler);


using var channel2 = GrpcChannel.ForAddress("https://localhost:8711", new GrpcChannelOptions { HttpClient = httpClient });
var client2 = new Address.AddressClient(channel2);
var reply2 = await client2.TestMethodAsync(
new AddressRequest { Address = "GreeterClient" });
留待后查,同时方便他人
联系我:[email protected]

发表回复

您的电子邮箱地址不会被公开。