I have a .net core 3.1 project I am attempting to build on an Ubuntu 20.04 virtual machine.
The project was building successfully, I now need to update one of the NuGet packages in the project. Once I change the package version in the .csproj file to the required version, when I either build or perform "dotnet restore" I get the following message:
/usr/share/dotnet/sdk/3.1.415/NuGet.targets(128,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/ic/Source/redacted.csproj]
/usr/share/dotnet/sdk/3.1.415/NuGet.targets(128,5): error : The SSL connection could not be established, see inner exception. [/home/ic/Source/redacted.csproj]
/usr/share/dotnet/sdk/3.1.415/NuGet.targets(128,5): error : The remote certificate is invalid according to the validation procedure. [/home/ic/Source/redacted.csproj]
If I browse to https://api.nuget.org/v3/index.json I can successfully view the json in the browser and the certificate appears to be trusted.
I have:
- Updated packages (apt-get update AND apt-get upgrade)
- Updated NuGet
- Set certificate thumbnails in NuGet.Config as per the update in this question: Problem resolving Nuget Packages in Devops Build Agent due to Certificate issues
- I can see the DigiCert root certificate for nuget.org in the trusted certificates on Ubuntu