编程语言
首页 > 编程语言> > C#4.0 HTTP协议无法使用TLS1.2的问题

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

作者:互联网

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

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

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

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

标签:768,HTTP,4.0,TLS1.2,ServicePointManager,192,SecurityProtocol,SecurityProtocolTyp
来源: https://www.cnblogs.com/playforever/p/15650996.html