curl:(60)SSL证书问题:自签名证书

时间:2020-06-02 01:51:29

标签: ssl github curl proxy

我想在Linux计算机上安装nvm。 (我的Debian版本是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.

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

发现我需要代理配置。

请先检查该呼叫之前是否确实需要任何代理。
For instance(未导出代理):

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

如果可行,那么问题就不同了。
如果没有,请重试代理服务器。