6

I would like to install nvm on my Linux computer. (My Debian version is 10, Git version is 2.27. and OPENSSL version is 1.1.1d 10 Sep 2019)

I read this document https://github.com/nvm-sh/nvm#install--update-script and I input this script.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

This is the result.

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
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.

I read this document https://curl.haxx.se/docs/sslcerts.html but I could not understand what to do. Therefore, I searched the Internet and found that I need proxy configuration.

export http_proxy="http://webfilter.**********.com:8000/"
export https_proxy="http://webfilter.**********.com:8000/"

I entered these commands in my terminal and tried this script again.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Then I get the same result.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
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.

Next, I put this command in my terminal

curl -Is http://www.google.com | head -1 | grep 200

and I get

HTTP/1.1 200 OK

That means I don't need proxy in my case.

Next, I tried this solution.

github: server certificate verification failed

sudo apt-get install --reinstall ca-certificates
sudo mkdir /usr/local/share/ca-certificates/cacert.org
sudo wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
sudo update-ca-certificates
git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt

I have done all these command and tried again, but got the same error message.

How can can I resolve this problem?

Kazuaki Suzuki
  • 1,025
  • 6
  • 19
  • 33
  • 3
    You need to download certificate from the site and use that during curl call. Or, you have to pass -k in curl command - that will indicate curl to have certificate less communication but that is security risk. For your case if you understand the Server you are communicating is valid one and no sensitive information is passed then you may go ahead with -k. – Alok Singh Jun 04 '20 at 01:49
  • 1
    There's no reason you should need anything other than the `ca-certificates` package installed to make this work. GitHub has a trusted certificate, and if you're having trouble with that, then you need to figure out what's going on that's tampering with your TLS connections. – bk2204 Jun 04 '20 at 02:50
  • @AlokSingh Thank you for your advice. I used -k and I was able to install nvm. Thank you so much. – Kazuaki Suzuki Jun 04 '20 at 04:31
  • 1
    @bk2204 You are right. My computers ssl certificate seems to be broken. I want to check it, but dont know how to do it. If you could help me, could you give me any advice, please? – Kazuaki Suzuki Jun 04 '20 at 04:34

1 Answers1

2

Have you tried this way?

curl -k https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh

Read man curl for clarity