我试图在ubuntu 18.04上构建dotnet项目。我在本地Azure Devops服务器存储库中存储了一些nuget数据包。我配置了https和自签名证书。我通过
添加了源dotnet nuget add source https://myurl/nuget/v3/index.json --name Int1 --username myuser --password mypasswd --store-password-in-clear-text --configfile nuget.config
[当我尝试执行还原时,出现以下错误:
/usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error : Unable to load the service index for source https://myurl/nuget/v3/index.json. [/home/Frontend/myproject.sln]
/usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error : The SSL connection could not be established, see inner exception. [/home/Frontend/myproject.sln]
/usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error : The remote certificate is invalid according to the validation procedure. [/home/Frontend/myproject.sln]
我将https://myurl/放到浏览器中,下载了.pem证书,将其放入/usr/share/ca-certificates/
并制成了dkpg-reconfigure ca-certificates
,但仍然出现错误。
卷曲也不起作用。
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
在Windows上,如果我将证书设置为root信任,则一切正常。在Linux上,有什么方法可以做同样的事情吗?
要在Ubuntu上安装.pem证书,您可能需要先将.pem证书转换为.crt证书。
您可以使用以下命令将.pem证书转换为.crt证书。
openssl x509 -outform der -in CERTIFICATE.pem -out CERTIFICATE.crt
然后将.crt复制到正确的位置:
sudo cp CERTIFICATE.crt /usr/local/share/ca-certificate
然后使用以下命令更新您的证书:
sudo update-ca-certificates
您可以查看this thread了解更多信息。