【发布时间】:2017-06-29 02:29:08
【问题描述】:
我目前正在尝试从 Linux 构建机器(dotnet 核心项目)将 NuGet 包部署到我们的本地 Nexus 服务器
但是,Nexus 服务器在 HTTPS 上运行,带有我的构建机器无法识别的公司域证书。
当我运行nuget push 时出现以下错误:
Pushing App.1.0.0.nupkg to 'https://v-nexus/repository/nuget/'...
PUT https://v-nexus/repository/nuget/
An error was encountered when fetching 'PUT https://v-nexus/repository/nuget/'. The request will now be retried.
Error: TrustFailure (The authentication or decryption has failed.)
The authentication or decryption has failed.
Invalid certificate received from server. Error code: 0xffffffff800b010a
PUT https://v-nexus/repository/nuget/
An error was encountered when fetching 'PUT https://v-nexus/repository/nuget/'. The request will now be retried.
Error: TrustFailure (The authentication or decryption has failed.)
The authentication or decryption has failed.
Invalid certificate received from server. Error code: 0xffffffff800b010a
PUT https://v-nexus/repository/nuget/
Error: TrustFailure (The authentication or decryption has failed.)
The authentication or decryption has failed.
Invalid certificate received from server. Error code: 0xffffffff800b010a
我试过了:
- 全局安装服务器证书(使用 update-ca-certificates)
- 使用 certmgr 安装证书
还有其他我错过的方法,或者这是在 Linux 中使用 NuGet 的一个已知问题。 (我正在使用 docker 容器,所以不希望解决方案是“使用 windows”!)这是我们自动构建系统的一部分,所以我仅限于 Linux docker 容器。
我的一所大学运行 Windows 能够毫无问题地推送包,所以我知道这不是服务器的问题。
【问题讨论】:
-
你试过
mozroots --import --sync吗? -
还要检查
ca-certificates包。如果您使用的是最新的 .NET Core CLI (1.0.0-rc4),则可以改用dotnet nuget push。nuget push是 NuGet 的第三方实现,由 Mono 提供。dotnet nuget push官方,由微软创建。 -
感谢您的指点。原来我试图使用域控制器的证书,而不是 CA 证书。呃! :)
标签: linux ssl nuget .net-core nexus