Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve SSL certificate: self signed certificate when cloning repo from github?

Tags:

git

github

ssl

I just installed git for windows and tried to clone glew's repo like this

$ git clone https://github.com/nigels-com/glew.git

But I got the following error

Cloning into 'glew'...
fatal: unable to access 'https://github.com/nigels-com/glew.git/': SSL certificate problem: self signed certificate

I've seen people running into this problem and some possible workarounds.

First try

$ git -c http.sslVerify=false clone https://github.com/nigels-com/glew.git
Cloning into 'glew'...
fatal: unable to access 'https://github.com/nigels-com/glew.git/': Empty reply from server

Second try

$ git config --global http.sslVerify false
$ git clone https://github.com/nigels-com/glew.git
Cloning into 'glew'...
fatal: unable to access 'https://github.com/nigels-com/glew.git/': Empty reply from server

Then I checked for http.sslcainfo entry in the config files

$ git config --system --list
credential.helper=manager

$ git config --global --list
https.proxy=<proxy-address>
http.sslverify=false

System and global config files does not have that entry. So I tried the following which I don't know what file is reading and try to unset it.

$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
http.sslverify=false

$ git config --unset http.sslcainfo
fatal: not in a git directory

Tried with global and system

$ git config --global --unset http.sslcainfo
$ git clone https://github.com/nigels-com/glew.git
Cloning into 'glew'...
fatal: unable to access 'https://github.com/nigels-com/glew.git/': SSL certificate problem: self signed certificate

$ git config --system --unset http.sslcainfo
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission denied
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Invalid argument

I still cannot clone that github repo. Any other idea I can try to fix this problem? What am I missing?

like image 396
BRabbit27 Avatar asked Aug 17 '16 19:08

BRabbit27


People also ask

How do I disable self-signed certificate in certificate chain?

A popular workaround is to disable SSL Verification using git config --global http. sslVerify false but that creates large security risks. SSL is a good thing & we should use it, even in cases where your company makes it difficult. The solution is to add the certificates to Git's trusted certificates.

How do I disable SSL certificate in github?

Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet. Run git config http. sslVerify false to disable SSL verification if you're working with a checked out repository already.


1 Answers

You can disable SSL verification using the below command

git config --global http.sslVerify false
like image 114
Amimo Benja Avatar answered Oct 04 '22 06:10

Amimo Benja