我正在使用WSL Ubuntu,对于某些站点,包括NuGet,它没有完整的证书链。
结果,我无法从NuGet添加或还原软件包。有办法绕过它吗?
示例:
dotnet restore
出现以下错误:
/usr/share/dotnet/sdk/3.0.100/NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/pomatti/Projects/dojo-for-net/solutions/WhiteBelt/WhiteBelt.sln]
/usr/share/dotnet/sdk/3.0.100/NuGet.targets(123,5): error : The SSL connection could not be established,see inner exception. [/home/pomatti/Projects/dojo-for-net/solutions/WhiteBelt/WhiteBelt.sln]
/usr/share/dotnet/sdk/3.0.100/NuGet.targets(123,5): error : The remote certificate is invalid according to the validation procedure. [/home/pomatti/Projects/dojo-for-net/solutions/WhiteBelt/WhiteBelt.sln]
更新
我尝试将所有证书手动添加到Ubuntu,但这没有用:
- 已将巴尔的摩,microsoft和NuGet证书复制到
/usr/local/share/ca-certificate
- 已执行
sudo update-ca-certificates
遇到相同的错误。