Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't clone a Github repo after setting http.sslCAInfo

Tags:

git

ssl

I had to manage a private git repo, so I created a .pem and set http.sslCAInfo to the path of the .pem. But now I can't clone from Github's repos anymore:

fatal: unable to access 'https://github.com/KidSysco/jquery-ui-month-picker/': server certificate verification failed. CAfile: /home/marco/sources/git_certs/cert.pem CRLfile: none

What's the default value of http.sslCAInfo? I tried to set it to "" but now I get

fatal: unable to access 'https://github.com/KidSysco/jquery-ui-month-picker/': Problem with the SSL CA cert (path? access rights?)

like image 668
Marco Sulla Avatar asked Dec 20 '22 08:12

Marco Sulla


2 Answers

Ok, I solved with

git config --global http.sslCAInfo /etc/ssl/certs/ca-certificates.crt

You can configure only the current repo with

git config http.sslCAInfo path/to/local.pem
like image 162
Marco Sulla Avatar answered Jan 31 '23 03:01

Marco Sulla


You can also run the following command to get the "right" directory that openssl is using (under Linux/Git Bash). This outputs the directory in quotes, so you shouldn't need to do any special magic to handle spaces and could pipe it right to another command.

openssl version -d | awk '{ print $2 }'

So you could fix your git config with:

git config --global http.sslCAInfo $(openssl version -d | awk '{ print $2 }')

like image 43
dragon788 Avatar answered Jan 31 '23 02:01

dragon788