请求中止:未能创建tls/sls安全通道解决方案

正常的解决方案,在请求前加上如下代码:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;

ServicePointManager.ServerCertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => { return true; };

.net3.5以后用

System.Net.ServicePointManager.SecurityProtocol = (SecurityProtocolType)0x00000C00;

如果是.net3.5请用tls12或者其他试试

你可能感兴趣的:(C#)