.net 启用TLS 1.2时,无法协商TLS 1.0
以下代码:.net 启用TLS 1.2时,无法协商TLS 1.0,.net,c#-4.0,https,webclient,tls1.2,.net,C# 4.0,Https,Webclient,Tls1.2,以下代码: using System.Net; namespace HttpsClient { class Program { static void Main(string[] args) { using (var client = new WebClient()) { ServicePointManager.SecurityProtocol = SecurityP
using System.Net;
namespace HttpsClient
{
class Program
{
static void Main(string[] args)
{
using (var client = new WebClient())
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
| SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback
+= (sender, certificate, chain, errors) => true;
var str = client.DownloadString(
"https://ssb.unwsp.edu/pls/banprod/twbkwbis.P_WWWLogin");
}
}
}
}
无法建立连接,它以System.Net.WebException结束请求被中止:无法创建SSL/TLS安全通道
正如Wireshark capture所示,服务器端拒绝使用TLS 1.2协议
当ServicePointManager配置为仅使用Ssl3和Tls时,可以成功建立连接
问题: