【问题标题】:All known steps have been taken but TLS 1.2 is still not working on Windows 7已采取所有已知步骤,但 TLS 1.2 仍无法在 Windows 7 上运行
【发布时间】:2021-07-20 16:38:23
【问题描述】:

我知道这是重复的,但我已经阅读了所有关于此的文章并实施了所有建议,但我仍然无法在我的环境中解决它。

我正在运行 Windows 7 Professional 64Bit - Service Pack 1

连接到使用(取自 IE)具有 256 位加密(高)的 TLS 1.2 AES 的公共网站;具有 256 位交换的 ECDH

我在注册表中设置了不同的 SCHANNEL\Protocols 组合,包括

TLS 1.0\Client\Enabled=0 + DisabledByDefault=1

TLS 1.1\Client\Enabled=0 + DisabledByDefault=1

TLS 1.2\Client\Enabled=1 + DisabledByDefault=0

我有一个使用 .NET Framework 4.6.1 的 C# 测试应用程序,同时尝试 HttpClient 和 HttpWebRequest

'''

    private void cmdGo_Click(object sender, EventArgs e)
    {
        ServicePointManager.ServerCertificateValidationCallback = (senderX, certificate, chain, sslPolicyErrors) => { return true; };
        ServicePointManager.Expect100Continue = true;
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;            

        HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(txtUrl.Text);
        httpRequest.Method = "POST";            

        try
        {
            HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();

        }
        catch (Exception exRes)
        {
            System.Text.StringBuilder msg = new StringBuilder();
            Exception child = exRes.InnerException;

            msg.AppendLine(exRes.Message);
            while (child != null)
            {
                msg.AppendLine(child.Message);
                child = child.InnerException;
            }

            MessageBox.Show(msg.ToString());
        }
    }

    private void cmdNewGo_Click(object sender, EventArgs e)
    {
        ServicePointManager.ServerCertificateValidationCallback = (senderX, certificate, chain, sslPolicyErrors) => { return true; };
        ServicePointManager.Expect100Continue = true;
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

        try
        {
            using (HttpClient client = new HttpClient())
            {
                using (HttpResponseMessage response = client.GetAsync(txtUrl.Text).GetAwaiter().GetResult())
                {
                    if (response.IsSuccessStatusCode)
                    {
                        string output = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();

                        MessageBox.Show(output);
                    }
                }
            }
        }
        catch(Exception ex)
        {
            System.Text.StringBuilder msg = new StringBuilder();
            Exception child = ex.InnerException;

            msg.AppendLine(ex.Message);
            while(child != null)
            {
                msg.AppendLine(child.Message);
                child = child.InnerException;
            }

            MessageBox.Show(msg.ToString());
        }
    }

'''

无论我尝试什么注册表设置组合或我添加的 SecurityProtocolType 值似乎都无法强制使用 TLS 1.2。

错误总是:请求被中止:无法创建 SSL/TLS 安全通道

我错过了什么或我做错了什么?

提前致谢。

【问题讨论】:

  • 您是否安装了相关更新? support.microsoft.com/en-us/topic/… 我可以温和地建议升级到受支持的 Windows 版本
  • TLS Cipher Suites in Windows 7 -- Windows 7 不支持一些新的(er) 密码套件(并且永远不会,正式地,因为非 ESU 客户的安全更新不久前停止了)。 -- Web 浏览器带来(和处理)它们自己的密码套件。
  • @Charlieface 谢谢你的链接。我将查看是否已应用此更新。是的,我们迫切需要升级到正在进行中的操作系统
  • @Jimi 也感谢您提供的链接。我也在寻找这种类型的答案,看看我们是否超出了可编码的修复范围。我将查看链接中的密码套件,看看提供给我们的新列表是否包含这些
  • 不能肯定地告诉你,但大多数情况下,如果你对 Windows 10 进行就地升级,它只会使用 Win7 许可证密钥

标签: c# ssl windows-7 httpclient tls1.2


【解决方案1】:

所以@Jimi 评论是正确答案。问题似乎是在端点服务器上删除了弱密码,只留下了 Windows 7 不支持的密码。

TLS Cipher Suites in Windows 7

如果有更好的方法来为 pronoun 评论提供 pronoun 的评价,我向 @Jimi 道歉。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-22
    • 1970-01-01
    • 2019-09-28
    相关资源
    最近更新 更多