HttpWebRequest访问https有安全证书拦截
//HttpWebRequest访问https有安全证书的问题( 请求被中止: 未能创建 SSL/TLS 安全通道。)
ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
在初始化或者某个地方写上这两行代码即可解决!
转:https://blog.csdn.net/MRK12/article/details/87120607