如何解决[卷曲:(60)SSL证书问题:证书链中的自签名证书]

时间:2020-06-04 01:42:43

标签: git ssl github curl

我想在Linux计算机上安装nvm。 (我的Debian版本是10,Git版本是2.27。并且OPENSSL版本是1.1.1d 2019年9月10日)

我阅读了本文档https://github.com/nvm-sh/nvm#install--update-script 然后输入此脚本。

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

这是结果。

 % 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.

我阅读了本文档https://curl.haxx.se/docs/sslcerts.html,但我不知道该怎么办。因此,我搜索了Internet,发现我需要代理配置。

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

我在终端中输入了这些命令,然后再次尝试了此脚本。

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

然后我得到相同的结果。

  % 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.

接下来,我将这个命令放在终端中

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

我得到

HTTP/1.1 200 OK

这意味着我不需要代理。

接下来,我尝试了此解决方案。

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

我已经完成了所有这些命令,然后再次尝试,但是得到了相同的错误消息。

如何解决此问题?

0 个答案:

没有答案