HttpWebRequest 请求被中止: 未能创建 SSL/TLS 安全通道
在HttpWebRequest前设置代码
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
在HttpClient 发起请求前设置:
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
client.GetAsync(......)
浙公网安备 33010602011771号