Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 启用TLS 1.2时,无法协商TLS 1.0_.net_C# 4.0_Https_Webclient_Tls1.2 - Fatal编程技术网

.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时,可以成功建立连接

问题:

  • WebClient不支持从TLS 1.2到TLS 1.0的协议版本协商,这是真的吗
  • 我可以通过某种方式对其进行配置以强制其协商TLS 1.0吗
  • 谢谢