54

I'm trying to run NuGet on Linux (Ubuntu 12). I have Mono 3.0.6 (compiled from source).

$ mono --runtime=v4.0.30319 .nuget/NuGet.exe update -self
Checking for updates from https://nuget.org/api/v2/.
Error getting response stream (Write: The authentication or decryption has failed.): SendFailure

The error is due to some certificate (the nuget.org one most likely) not being trusted, I gather. This blog post has more details.

So I've run:

$ mozroots --import --sync
$ certmgr -ssl https://go.microsoft.com
$ certmgr -ssl https://nugetgallery.blob.core.windows.net
$ certmgr -ssl https://nuget.org

... to no avail.

NuGet Version is 2.3.0.0 (although I started out with some older version that also did not work either).

How can I fix this error?

3
  • Are you getting the exact same error after importing the SSL certificates ?
    – Tuxdude
    Mar 3, 2013 at 2:55
  • I honestly don't remember if it was different before importing the certificates.
    – friism
    Mar 3, 2013 at 3:05
  • I just want to link this related, very helpful article dlafferty.blogspot.no/2013/08/…
    – angularsen
    Jan 28, 2014 at 18:06

1 Answer 1

112

I was able to get this working by importing the certificates into the machine store and not the user store, which is the default:

$ sudo mozroots --import --machine --sync
$ sudo certmgr -ssl -m https://go.microsoft.com
$ sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net
$ sudo certmgr -ssl -m https://nuget.org

I verified that before I did this — even after having done the original user store-based commands — the tlstest.exe tool failed, and after importing into the machine store it succeeded.

And, most important to me of course, nuget started working then too. :)

10
  • If you get an error on the first command - please see this answer: askubuntu.com/questions/331519/… Sep 25, 2013 at 10:36
  • Thanks, this helped me get nuget working on cloud9. :-) Aug 15, 2014 at 12:03
  • This helped me to install OmniSharp (for Mono) on Ubuntu 14.04/Trusty, which otherwise fails with an obtuse error....
    – EdwardG
    Dec 11, 2014 at 18:17
  • 1
    @AaronLerch you are right: [...].nuget/NuGet.targets: error : Command 'mono --runtime=v4.0.30319 [...]/NuGet.exe install "packages.config" -source "" -o "/opt/OmniSharpServer/packages"' exited with code: 1.
    – EdwardG
    Dec 13, 2014 at 22:12
  • 4
    When running the last command, the output ends with: "*** WARNING: Certificate signature is INVALID *** Import this certificate into the CA store ?". Is this normal? This is a bit scary. May 12, 2015 at 9:18

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.