andreyP2001
andreyP2001

Reputation: 21

dotnet nuget ssl problem on linux azure devops

I trying to build dotnet project on ubuntu 18.04. I have some some nuget packets stored on local Azure Devops server repository. I have https and self-signed certificate configured. I added source via

dotnet nuget add source https://myurl/nuget/v3/index.json --name Int1 --username myuser --password mypasswd --store-password-in-clear-text --configfile nuget.config

When i try to perform restore i've got the following error:

/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]

I put https://myurl/ to a browser, downloaded the .pem certificate , put it into /usr/share/ca-certificates/ and made dkpg-reconfigure ca-certificates but it's still gives an error.

Curl is not working too.

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.

On Windows if I place my certificate as root trusted everything works fine. Is where any way to do the same on linux ?

Upvotes: 2

Views: 1306

Answers (1)

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30363

To install .pem certificate on Ubuntu, you might need to convert .pem certificate to .crt certificate first.

You can use below command to convert .pem certificate to .crt certificate.

openssl x509 -outform der -in CERTIFICATE.pem -out CERTIFICATE.crt

Then Copy .crt into the proper location:

sudo cp CERTIFICATE.crt /usr/local/share/ca-certificate

And then update your certificate with below command:

sudo update-ca-certificates

You can check out this thread for more information.

Upvotes: 0

Related Questions