C#4.0 HTTP协议无法使用TLS1.2的问题

在发送HTTP请求前加入下行代码

ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;

如果是4.5以上版本可以直接使用

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;

 

  

posted @   Merray  Views(10449)  Comments(4Edit  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示