【问题标题】:Azure Pipelines local agent failing to connect with SSL errorAzure Pipelines 本地代理无法连接 SSL 错误
【发布时间】:2022-07-02 04:58:51
【问题描述】:

我们有一个本地服务器 (Windows Server 2012 R2),上面运行着 Azure Pipelines 代理。今天(2022 年 1 月 31 日),此代理无法再连接到我们的 Azure DevOps 组织。

从日志文件来看,我认为这是因为它正在尝试连接较旧的 TLS 版本,该版本从今天开始不再可用 - https://devblogs.microsoft.com/devops/azure-devops-services-to-require-tls-1-2/

所以我按照有关如何确保启用 TLS 1.2 的说明进行操作,并在注册表编辑器中确认我的设置,并运行此处建议的 PowerShell 脚本 - https://docs.microsoft.com/en-us/security/engineering/solving-tls1-problem#update-windows-powershell-scripts-or-related-registry-settings

一切似乎都很好,但仍然无法解决相同的问题。机器也已重新启动。如果我在内置的 Internet Explorer 浏览器中尝试它请求的 URL,它会失败,但使用 Chrome 会成功,所以它必须仍在尝试连接 TLS 1.2,但我不知道为什么。我也尝试过重新安装代理(使用最新版本),但由于同样的错误而失败。有什么建议吗?

【问题讨论】:

  • 我有同样的问题,在 2012 R2 服务器中,其他服务器工作正常。试图更改我能够找到的注册表中的任何相关内容,并安装了 .net 框架 - 但无法弄清楚出了什么问题。
  • 如果你比我更了解这一点,那可能会有所帮助:developercommunity.visualstudio.com/t/…

标签: azure-devops azure-pipelines tls1.2 windows-server-2012-r2


【解决方案1】:

在服务器上使用 IISCrypto 启用 Cyphers 下方帮助我们解决了问题

密码套件

TLS 1.2(服务器优先顺序的套件)

  • TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x9f) DH 2048 位 FS 256
  • TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x9e) DH 2048 位 FS 128

来自Vijay's solution

【讨论】:

  • 好找,我搜的时候没找到!
  • 请注意,您必须重新启动服务器才能应用设置。 IIS Crypto 包含一个 /reboot 选项。如果您使用组策略,则必须强制更新策略,然后重新启动。
【解决方案2】:

在受影响的计算机上,您可以尝试使用 AzDO TLS 1.2-transition 就绪检查器运行分析:https://github.com/microsoft/azure-devops-tls12/blob/main/AzureDevOpsTls12Analysis.ps1

该脚本检查是否启用了客户端 TLS 1.2,检查密码套件问题并检查是否存在使旧版 .NET Framework 应用支持 TLS 1.2 所需的开关。根据调查结果,它会打印缓解建议或生成量身定制的缓解脚本 (ps1)。

模拟问题中描述的问题,脚本给出建议:

MITIGATION 'gpeditREM': via Local Group Policy setting
    Run gpedit.msc:
    - Navigate to "Computer Config/Administrative Templates/Network/SSL Config Settings"
    - Choose setting "SSL Cipher Suite Order" -> Edit
    - If 'Enabled' is not checked, then continue to the next mitigation below.
    - If 'Enabled' is checked:
      - *either* change to 'Not configured' (resets to OS-default setting)"
      - *or* keep 'Enabled' and in field 'SSL Cipher Suites' add at least one of the following items to comma-separated list:
        TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
        TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
    - Press 'OK' button
    Restart the computer

MITIGATION 'regFunctionsDEL': deletion of cipher suite list in registry
    Mitigation script generated at .\Mitigation-regFunctionsDEL.ps1
    Run the mitigation script as Administrator:
    - If 'Done!' is printed, then operation was successfull.
    - If 'Mitigation was not effective!' is printed, then cipher suites are enforced via domain GPO - talk to your domain administrator.

Screenshot: TLS 1.2-transition readiness checker on WS 2012 R2

Windows Server 2012 R2(及更早版本)容易受到密码套件问题的影响,因为它仅支持 AzDevOps 当前所需的四分之二的 TLS 1.2 密码套件(即使这两个仅在应用 this update 时才受支持)。

请记住,Azure DevOps 回滚了 1 月 31 日弃用的 TLS 1.0/1.1(IPv6 终结点除外)。目前计划在 2022 年 3 月 31 日之前完全弃用 (announcement)

更新(2022 年 5 月):Azure DevOps 团队已完成对 dev.azure.com 域的 TLS 1.0/1.1 弃用。子域 *.visualstudio.com 将紧随其后。

【讨论】:

  • 谢谢。该工具为我们揭示了两个缺失的密码。添加,重新启动,一切正常。
【解决方案3】:

由于TLS 1.2 mandate,我们遇到了 Azure DevOps 无法发布到 Azure App Services 的问题。我们有自托管代理,尽管显示已安装 .NET 4.8 的框,我们在提升的命令提示符下运行以下注册表编辑 this doc 恢复连接:

reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:64

reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:32

【讨论】:

    【解决方案4】:

    朋友们,我也遇到了同样的情况,但是我通过在服务器上安装这个应用程序来解决它,它用于一键激活 TLS2 协议和 SSL 密码套件

    https://www.nartac.com/Products/IISCrypto/

    TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x9f) DH 2048 位 FS 256 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x9e) DH 2048 位 FS 128

    我希望它对你有用,让我们继续摇摆吧!

    【讨论】:

      猜你喜欢
      • 2022-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-11
      • 1970-01-01
      • 2019-11-01
      相关资源
      最近更新 更多