访问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;
原文地址:https://www.cnblogs.com/TbKing-blogs/p/11122064.html