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;安全

相關文章
相關標籤/搜索