当请求Web数据时,“请求被中止: 未能创建 SSL/TLS 安全通道”的问题
在https请求之前加
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; //加上这一句
本文解决了一个常见的Web数据请求问题:请求被中止:未能创建SSL/TLS安全通道。通过在https请求前添加一行代码,即设置System.Net.ServicePointManager.SecurityProtocol为SecurityProtocolType.Tls12,可以有效解决此问题。
当请求Web数据时,“请求被中止: 未能创建 SSL/TLS 安全通道”的问题
在https请求之前加
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; //加上这一句
1万+
4834

被折叠的 条评论
为什么被折叠?