gpt4 book ai didi

powershell - DotNet NuGet 推送导致 PowerShell 出现 TLS 错误

转载 作者:行者123 更新时间:2023-12-05 05:51:23 31 4
gpt4 key购买 nike

我们在将包发布到 Nuget 的 CI/CD 管道中遇到问题。

在 PowerShell 上执行此命令:

& dotnet nuget push "*.nupkg"--api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate

导致以下输出:

error: Não é possível carregar o índice de serviço para a origem https://api.nuget.org/v3/index.json.
error: The SSL connection could not be established, see inner exception.
error: Unable to read data from the transport connection: Foi forçado o cancelamento de uma conexao existente pelo host remoto..
error: Foi forçado o cancelamento de uma conexao existente pelo host remoto.

我们之前已经尝试过执行:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bOR [Net.SecurityProtocolType]::Tls12

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

我们使用的是 Windows Server 2012。已经更改了注册表项以也使用 Tls12。

编辑:

MSFT Edge//IE

msft edge // ie

Internet Explorer 设置 ie settings

最佳答案

我在几周前使用以下注册表项解决了这个错误:

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

关于powershell - DotNet NuGet 推送导致 PowerShell 出现 TLS 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70380626/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com