访问HTTPS网站,因SSL协议问题,导致请求立即断开连接

错误信息:

InnerException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

Message: The underlying connection was closed: An unexpected error occurred on a send.
 

解决方案:

在发起请求的地方加入如下SSL相关设置。

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

 

posted @ 2019-07-02 17:36  _Tbz  阅读(863)  评论(0)    收藏  举报