我正在尝试在 Github 上克隆一个存储库,但我遇到了 SSL 证书问题。
$ git clone https://github.com/HonzaKral/django-threadedcomments.git
Initialized empty Git repository in /Users/Bryan/work/django-threadedcomments/.git/
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/HonzaKral/django-threadedcomments.git/info/refs
fatal: HTTP request failed
如何安装适当的证书?
编辑:通过使用 git://和 https://,我能够完全避免这个问题
最佳答案
打开 Keychain Access,选择“System Roots”中的所有证书(除了被划掉的证书,如果有的话),右键单击并将所有项目导出到 PEM 文件中。
然后,使用 git config --system http.sslCAInfo/path/to/this/file.pem
。如果您不想在克隆该特定存储库之前使用 --system
进行全局设置,您可以在 GIT_SSL_CAINFO
环境变量中设置此路径(例如 GIT_SSL_CAINFO =/path/to/this/file.pem git clone ...
).这将使 Git(和 libcurl)将该文件用作受信任的 CA 文件。 (您可以在 git-config man-page 中查看此选项的详细信息。)
关于macos - 如何在 OS X 上安装 SSL 证书以便从 Github 克隆项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9264078/