Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssl Grpc.core TLS与本地主机自签名证书握手_Ssl_Grpc_Grpc C# - Fatal编程技术网

Ssl Grpc.core TLS与本地主机自签名证书握手

Ssl Grpc.core TLS与本地主机自签名证书握手,ssl,grpc,grpc-c#,Ssl,Grpc,Grpc C#,我有一个gRPC服务在我的本地机器上运行,它需要通过TLS进行请求 当我使用Grpc.Net.Client库时,以下工作正常: var channelGrpcNetClient = GrpcChannel.ForAddress("https://localhost:5003"); var clientGrpcNetClient = new ProvisionClient(channelGrpcNetClient); await clientGrpcNetClient.Crea

我有一个gRPC服务在我的本地机器上运行,它需要通过TLS进行请求

当我使用Grpc.Net.Client库时,以下工作正常:

var channelGrpcNetClient = GrpcChannel.ForAddress("https://localhost:5003");
var clientGrpcNetClient = new ProvisionClient(channelGrpcNetClient);
await clientGrpcNetClient.CreateAsync(createRequest);
然而,当我尝试在Grpc.Core中做类似的事情时,它不再工作了

var channelGrpcCore = new Channel("https://127:0:0:1", 5003, new SslCredentials());
var clientGrpcCore= new ProvisionClient(channelGrpcCore );
await clientGrpcCore.CreateAsync(createRequest);
这是我得到的例外:

Grpc.Core.rpceException:“状态(Status)(StatusCode=“Unavailable”,Detail=“无法连接到所有地址”,DebugException=“Grpc.Core.Internal.CoreErrorDetailException:{”created:“@1622691838.697000000”,“description:”未能拾取子频道”,“文件”:“…\src\Core\ext\filters\client\u channel\client\u channel.cc”,“文件行”:5420,“引用的错误”“:[{”created:“@1622691838.697000000”,“description:“无法连接到所有地址”,“file:”…\src\core\ext\filters\client\u channel\lb\u policy\pick\u first\pick\u first.cc”,“file\u line:“398,”grpc\u状态:14}”)”

Grpc.Core库是否不允许TLS连接本地主机自签名证书?Grpc.Core似乎使用BoringSSL,这与Grpc.Net.Client使用的库不同。我想知道是否有解决此问题的方法,允许在本地运行客户端和服务器,并且只使用自签名证书证书。

”https://127:0:0:1“
-这既不是主机名也不是IP地址,但似乎是必需的。主机名应该是
“localhost”
,IP
“127.0.0.1”