TFS 休息 api 调用休息方法 "The underlying connection was closed: An unexpected error occurred on a receive"
TFS rest api Invoke-restmethod "The underlying connection was closed: An unexpected error occurred on a receive"
我正在尝试在 Azure DevOps 发布管道中的一项 powershell 任务中调用 TFS and/or Azure DevOps REST Api。我在两个不同的服务器(安装了 azure 管道代理)中尝试了 运行 相同的剩余 api 代码,但其中一个正在工作,其中一个 returns "The underlying connection was closed: An unexpected error occurred on a receive.."。两个代理服务器都启用了 tls 1.1 和 1.2。工作服务器有 powershell v 4.0,returns 错误的服务器有 v5.0。
当我 运行“[Net.ServicePointManager]::SecurityProtocol”时,两个服务器都返回 ssl3,Tls。
我有一个针对 returns 错误的服务器的解决方法,方法是使用
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
但我想知道为什么我需要在其中一台服务器上强制使用 TLS 1.2 而不是其他服务器,因为它们看起来具有相同的 TLS 配置。
在不太了解服务器的情况下,可能会使用 PowerShell V4 在该服务器上设置注册表项设置。
您可以检查以下注册表项,看看它们是否具有以下属性:
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
我正在尝试在 Azure DevOps 发布管道中的一项 powershell 任务中调用 TFS and/or Azure DevOps REST Api。我在两个不同的服务器(安装了 azure 管道代理)中尝试了 运行 相同的剩余 api 代码,但其中一个正在工作,其中一个 returns "The underlying connection was closed: An unexpected error occurred on a receive.."。两个代理服务器都启用了 tls 1.1 和 1.2。工作服务器有 powershell v 4.0,returns 错误的服务器有 v5.0。
当我 运行“[Net.ServicePointManager]::SecurityProtocol”时,两个服务器都返回 ssl3,Tls。
我有一个针对 returns 错误的服务器的解决方法,方法是使用 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 但我想知道为什么我需要在其中一台服务器上强制使用 TLS 1.2 而不是其他服务器,因为它们看起来具有相同的 TLS 配置。
在不太了解服务器的情况下,可能会使用 PowerShell V4 在该服务器上设置注册表项设置。
您可以检查以下注册表项,看看它们是否具有以下属性:
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord