git - 如何解决[curl : (60) SSL certificate problem: self signed certificate in certificate chain]

标签 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但我不知道该怎么办。于是上网搜索了一下,发现需要代理配置。

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

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

我该如何解决这个问题?

最佳答案

你试过这种方法吗?

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

为了清楚起见,阅读 man curl

关于git - 如何解决[curl : (60) SSL certificate problem: self signed certificate in certificate chain],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62185514/

相关文章:

windows - 如何从 .cer 和 .key 获取 .pfx 文件?

ios - 此服务器的证书无效

windows - Windows 上存储的 github 身份验证 token 在哪里?

xcode - 使用 Xcode 的 GIT 教程

git - 为什么在 Visual Studio Code 中尝试使用 "git checkout"时不能切换分支

swift - Mac OsX 控制台应用程序 NSURLSession Ssl 问题

github - 在 CircleCI 中安装 GitHub 包

GitHub 操作在 npm ci 上失败

python - 使用 Zenhub API 从 Github 问题创建史诗

git - 获取远程 git 存储库上的文件/文件树列表