打赏

Could not establish trust relationship for the SSL/TLS secure channel

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

 

 

 意思是:请求的接口不支持Https,改为http试试

如何配置服务支持https?根据域名解析到kong网关,kong网关配置证书,支持https

postman用https调用,好使了,但是程序使用https调用还是不好使,报下面的错:

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) 

 

 

经常排查,kong网关只支持TLSv1.2,加上TLSv1和TLSv1.1,reload后终于好使了,或者在程序中加

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;

参考:https://blog.csdn.net/jl1134069094/article/details/82496761

https://www.cnblogs.com/Jack-Blog/p/13170728.html

posted @ 2022-07-28 10:04  刘奇云  阅读(811)  评论(0编辑  收藏  举报