简体   繁体   中英

How do I install SSL certificates on OS X so I can clone projects from Github?

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://

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 the GIT_SSL_CAINFO environment variable (eg 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 .)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM