我从今天早上就收到了这个问题。 我无法再从 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/