.net - 在 dotnet 命令行中出现 SSL 错误
问题描述
从今天早上我就收到了这个问题。我不再能够从 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:我dotnet build
从 Docker 内部尝试,它可以工作,所以我认为问题来自我的安装。
解决方案
我发现了问题,它来自丢失的证书。
在我的/etc/ssl/certs
中,我有一个指向丢失证书 ( 0c31d5ce -> ssl-cert-snakeoil.pem
) 的死链接。
我使用以下命令重新创建丢失的证书,并且一切正常。
sudo make-ssl-cert generate-default-snakeoil --force-overwrite
推荐阅读
- c# - 在调试模式下禁用 Roslyn Analyzer
- react-native - TypeError:无法读取 react-native 中未定义的属性“长度”
- express - 部署 Firestore 功能后如何连接到 Websocket 服务器
- primefaces - Primefaces DatePicker 范围选择与时间
- excel - Excel动态预测图
- python - PyDM 在读取指数变量时生成警告
- sql - 表A中表B的列值总和,是否有自动方法?这是好习惯吗?- 甲骨文 SQL
- admob - GDPR-UMP SDK 并将同意转发给中介 sdks
- php - 访问 php 数组的各个部分
- sql - 基于sql对象的授权检查