The underlying connection was closed: An unexpected error occurred on a receive

解决方法

webRequest.KeepAlive = false;
ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true;web

 //WebRequest请求被停止: 未能建立 SSL/TLS 安全通道  在请求以前插入TLS安全协议:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;安全

相关文章
相关标签/搜索