2

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 ?

1
  • 1
    Hi, Did you get a chance to try out below solution. How did it go? Commented May 26, 2020 at 9:07

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.