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

.net 在dotnet命令行中获取SSL错误,.net,ssl,openssl,.net-core,.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/py

从今天早上起我就收到了这个问题。 我无法再从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的问题,但我无法修复它。 我尝试重新安装dotnetsdk,openssl,它没有任何改变

你知道这是从哪里来的吗

编辑:我在Ubuntu 16.04上


编辑2:我从Docker内部尝试了
dotnet build
,它可以工作,因此我认为问题来自我的安装。

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

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

我用下面的命令重新创建丢失的证书,然后一切都恢复正常

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

在什么操作系统上?首先使用Wireshark分析TLS握手,因为这将显示初始数据,让您开始。@LexLi我在ubuntu上。我尝试在docker中使用dotnet命令,它使用相同的版本。看来我电脑上的证书坏了,但我不知道在哪里。该错误无法确定丢失了哪个文件:(