Click here to Skip to main content
15,882,163 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I've just started seeing this error on one of my boxes when building a net core Web api on Linux Ubuntu 20.04

It was working perfectly yesterday and still is on my other Linux boxes
I must have inadvertently changed something but I can't think what


dotnet publish -c Release -o /var/www/CommandsAPI/

Microsoft (R) Build Engine version 17.0.0-preview-21378-03+d592862ed for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...

/usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/mnt/Docker/Jenkins/jenkins/workspace/CommandsAPI/CommandsAPI.sln]
/usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/NuGet.targets(131,5): error :   The SSL connection could not be established, see inner exception. [/mnt/Docker/Jenkins/jenkins/workspace/CommandsAPI/CommandsAPI.sln]
/usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/NuGet.targets(131,5): error :   The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot [/mnt/Docker/Jenkins/jenkins/workspace/CommandsAPI/CommandsAPI.sln]


What I have tried:

Hi all,
I've just started seeing this error on one of my boxes when building a net core Web api on Linux Ubuntu 20.04

It was working perfectly yesterday and still is on my other Linux boxes
I must have inadvertently changed something but I can't think what


dotnet publish -c Release -o /var/www/CommandsAPI/

Microsoft (R) Build Engine version 17.0.0-preview-21378-03+d592862ed for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...

/usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/mnt/Docker/Jenkins/jenkins/workspace/CommandsAPI/CommandsAPI.sln]
/usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/NuGet.targets(131,5): error :   The SSL connection could not be established, see inner exception. [/mnt/Docker/Jenkins/jenkins/workspace/CommandsAPI/CommandsAPI.sln]
/usr/share/dotnet/sdk/6.0.100-preview.7.21379.14/NuGet.targets(131,5): error :   The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot [/mnt/Docker/Jenkins/jenkins/workspace/CommandsAPI/CommandsAPI.sln]
Posted
Updated 5-Dec-21 0:53am

1 solution

Got around it by removing and reinstalling ca-certificates - not ideal but it worked

apt remove --purge -V ca-certificates
apt install ca-certificates -y
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900