在调用WebClient时,有时报“请求被中止:未能创建SSL/TLS安全通道。”的故障,网上有不少方法是写道在WebClient前加入安全配置协议:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
//| SecurityProtocolType.SystemDefault //注意:不要加入此行
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
但要注意的是,SecurityProtocolType.SystemDefault协议不要加,这样在调用WebClient就不会报错啦!
标签:TLS,中止,SystemDefault,SSL,SecurityProtocolType,WebClient From: https://www.cnblogs.com/east115/p/17691001.html