2

I would like to install nvm on my Linux computer. (My Debian version is 10.)

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.

How can can I resolve this problem?

Usama Abdulrehman
  • 1,041
  • 3
  • 11
  • 21
Kazuaki Suzuki
  • 1,025
  • 6
  • 19
  • 33

1 Answers1

1

found that I need proxy configuration.

Check first if you did need any proxy before that call.
For instance (without proxy exported):

curl -Is http://www.google.com | head -1 | grep 200; if [[ $? -eq 0 ]]; then; echo "Online"; else; echo "Offline"; fi

If that works, then the issue is different.
If not, try again with your proxy in place.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you very much for your answer. I copy and paste on my terminal, and get this message. ```bash: unexpected token `;' syntax error``` Could you help me please? – Kazuaki Suzuki Jun 02 '20 at 06:08
  • 1
    @KazuakiSuzuki Then simplify first, and test with just `curl -Is http://www.google.com | head -1 | grep 200` – VonC Jun 02 '20 at 06:09
  • I get ```HTTP/1.1 200 OK``` – Kazuaki Suzuki Jun 02 '20 at 06:15
  • 1
    @KazuakiSuzuki That means you don't need proxy in your case. – VonC Jun 02 '20 at 06:18
  • Really!!!! Could you tell me how can I find my problem, please? – Kazuaki Suzuki Jun 02 '20 at 06:20
  • 1
    @KazuakiSuzuki Can you check if you have the openssl package installed? (as in https://stackoverflow.com/a/57885621/6309) – VonC Jun 02 '20 at 06:24
  • ```OpenSSL> version OpenSSL 1.1.1d 10 Sep 2019``` openssl is installed. – Kazuaki Suzuki Jun 02 '20 at 06:31
  • 1
    @KazuakiSuzuki What is you version of Git, and what does `git config -l` return? Anything relate to `http.sslXXX`? (https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpsslCert) I mentioned `http.sslCAinfo` in https://stackoverflow.com/a/35824116/6309. – VonC Jun 02 '20 at 06:50
  • ```git version 2.20.1``` ```git config -l``` command returns nothing. – Kazuaki Suzuki Jun 02 '20 at 07:21
  • Does this mean I need git configuration? – Kazuaki Suzuki Jun 02 '20 at 07:24
  • Now I understand that I should write something in ~/.gitconfig – Kazuaki Suzuki Jun 02 '20 at 07:28
  • 1
    @KazuakiSuzuki Possibly, as mentioned in https://stackoverflow.com/a/35824116/6309 (reinstalling ca-certificate is a good tip). But upgrading Git to 2.27 (or at least 2.26.2) would be also sensible, to check if the issue persists. – VonC Jun 02 '20 at 07:29
  • Thank you very much for your help. Now I am trying. Just a moment please. – Kazuaki Suzuki Jun 02 '20 at 07:34
  • I am reinstalling git now. I will try ca-certificate tomorrow. I am glad if you could help me tomorrow. Thank you so much! – Kazuaki Suzuki Jun 02 '20 at 08:00
  • I tried stackoverflow.com/a/35824116/6309 . ```sudo apt-get install --reinstall ca-certificates``` and ```sudo mkdir /usr/local/share/ca-certificates/cacert.org``` worked. However, ```sudo wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt``` didnt work. I got ```connecting to www.cacert.org (www.cacert.org)|213.154.225.245|:80 ... failed : connection is timed out``` Could you tell me what to do please? – Kazuaki Suzuki Jun 03 '20 at 00:01
  • @KazuakiSuzuki Please see https://chat.stackoverflow.com/rooms/215139/discussion-between-kazuaki-suzuki-and-vonc – VonC Jun 03 '20 at 05:25