如何在 OS X 上安装 SSL 证书以便可以从 Github 克隆项目?
我正在尝试克隆 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:// 完全避免这个问题
I am trying to clone a repository at Github, but I am getting SSL Certificate problems.
$ 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
How do I install the appropriate certificates?
EDIT: I was able to avoid the issue entirely by using git:// versus https://
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
打开Keychain Access,选择“系统根目录”中的所有证书(除非有划掉的证书),右键单击并将所有项目导出到 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 手册页 中查看此选项的详细信息.)Open Keychain Access, select all the certificates in "System Roots" (except those crossed out, if any), right click and export all the items into a PEM file.
Then, use
git config --system http.sslCAInfo /path/to/this/file.pem
. If you don't want to set this globally with--system
before cloning that particular repository, you can set this path in theGIT_SSL_CAINFO
environment variable (e.g.GIT_SSL_CAINFO=/path/to/this/file.pem git clone ...
). This will make Git (and libcurl) use that file as the trusted CA file. (You can check the details for this option in the git-config man-page.)