.net - 在 dotnet 命令行中获取 SSL 错误

标签 .net ssl openssl .net-core

我从今天早上就收到了这个问题。 我无法再从 dotnet 命令行恢复/构建/添加包。

我收到以下错误:

» dotnet build
Microsoft (R) Build Engine version 15.7.179.6572 pour .NET Core
Copyright (C) Microsoft Corporation. Tous droits réservés.

  Restauration des packages pour /home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj...
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error : Impossible de charger l'index de service pour la source https://api.nuget.org/v3/index.json. [/home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj]
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error :   The SSL connection could not be established, see inner exception. [/home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj]
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error :   error:2006D080:BIO routines:BIO_new_file:no such file [/home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj]

ÉCHEC de la build.

/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error : Impossible de charger l'index de service pour la source https://api.nuget.org/v3/index.json. [/home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj]
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error :   The SSL connection could not be established, see inner exception. [/home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj]
/usr/share/dotnet/sdk/2.1.301/NuGet.targets(114,5): error :   error:2006D080:BIO routines:BIO_new_file:no such file [/home/ebernard/Documents/python/test_dotnet_console/retard-cli/retard-cli.csproj]
    0 Avertissement(s)
    1 Erreur(s)

Temps écoulé 00:00:01.53

这显然是 ssl 的问题,但我无法修复它。 我尝试重新安装 dotnet-sdk、openssl,它没有任何改变。

您知道这可能来自哪里吗?

编辑:我在 Ubuntu 16.04 上

编辑 2:我从 Docker 内部尝试 dotnet build 并且它有效,所以我认为问题来 self 的安装。

最佳答案

我发现了问题,它来自丢失的证书。

在我的 /etc/ssl/certs ,我有一个指向丢失证书的死链接 ( 0c31d5ce -> ssl-cert-snakeoil.pem )。

我使用以下命令重新创建了丢失的证书,然后一切又恢复正常了。

sudo make-ssl-cert generate-default-snakeoil --force-overwrite

关于.net - 在 dotnet 命令行中获取 SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51190605/

相关文章:

java - 将 netty 与 ssl 证书一起使用的简单方法?

c++ - 使用 char 数组公钥的 OpenSSL 的 RSA 加密

c++ - 处理 SSL 客户端不读取所有数据

c# - 更改 OWIN .expiration 和 .issued 日期的 DateTime 格式

c# - 如何在c#中声明动态数组

.net - 将流上传和下载到 Azure Blob

java - SSL 握手警报 : unrecognized_name error since upgrade to Java 1. 7.0

Android SSL 证书固定与改造

c++ - 安装 cocoa pod 后,现有静态库不使用 libssl.a 进行 tls 连接并且访问权限不佳

asp.net - 使用 Web Deploy 部署 .NET 4.5 Web 应用程序