-2

我正在使用Azure DevOps 迁移工具v11.9.47.0 将一些工作项从 https://azdevopsA/collectionA 迁移到 https://azdevopsB/collectionB(均为本地 Azure DevOps 2019),但出现错误。当我运行命令时:

.\migration.exe execute --config .\configuration.json

显示以下异常:

MigrationClient: Connecting to https://azdevopsA/collectionA/

[15:38:29 ERR] Unable to configure store

Microsoft.TeamFoundation.TeamFoundationServiceUnavailableException: TF400324: Azure DevOps services are not available from server https://azdevopsA/collectionA/. Technical information (for administrator):

The underlying connection was closed: Could not establish trust relationship for the SSL / TLS secure channel. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL / TLS secure channel.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

我将自签名证书导入证书链没有任何问题。我可以在浏览器中访问没有 SSL/TLS 验证的页面,但是当我尝试使用 migration.exe 工具时,出现上述问题。

4

1 回答 1

1

连接失败可能是由于客户端和/或服务器配置为仅协商 TLS 1.2。您可以在以下情况下检查解决方案:

https://developercommunity.visualstudio.com/t/azure-devops-api-could-not-establish-trust-relatio/410204

由于 Windows PowerShell 在默认情况下不启用 TLS 1.2 的 .NET Framework 4.5 上运行,因此无法建立连接。

对于每个脚本/每个会话的修复,运行以下命令以启用 TLS 1.2 支持:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

有关 .NET Framework 版本和 TLS 的更多信息,请参见: https ://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

于 2021-05-04T04:08:47.767 回答