23

I've been unable to git clone just about any github repo because of this error

fatal: unable to access 'github_url': server certificate verification failed. CAfile: /home/ubuntu/.ssh/rel3_dodroot_2048.crt CRLFile: none

I've noticed a few other people have had a similar error, but with the certificate in the .ssl folder. I've never seen anyone have this problem with the certificate in the .ssh though, and I have no idea how to fix it.

Environment:

Msquared
  • 842
  • 1
  • 6
  • 13

6 Answers6

38

Ok, I found the solution... I guess a script (I hadn't looked at) ran on my computer which ran the line

git config --global http.sslVerify true

So the solution was simply to change run

git config --global http.sslVerify false

Heh...

Msquared
  • 842
  • 1
  • 6
  • 13
  • I was trying to download using git clone in an ubuntu vm which I created on my PC. This worked for me. – user4002112 May 01 '20 at 23:44
  • 5
    This answer should at least add a warning saying doing this could potentially increase your security risk. You are disabling SSL verification, and on a global scale. Ideally, you add that git server's certificate to your local machine so it will trust this server. Even if you don't do that, disable SSL verify in the one repo only, not globally. – Girl Spider Oct 24 '21 at 17:10
9

I get same error like this and I run following command:

export GIT_SSL_NO_VERIFY=1

It works for me and I am using Ubuntu OS.

Kaumadie Kariyawasam
  • 1,232
  • 3
  • 17
  • 35
  • 1
    +1 great. And you can use it without making the change permanent like 'GIT_SSL_NO_VERIFY=1 git clone ...' which is better for security. – Daniel Bişar Jan 10 '22 at 07:31
6

Careful with disabling security features like certificate verification! This error indicates that there's some misconfiguration of your machine, assuming GitHub.com actually does have a valid cert. Overriding the error by disabling verification just adds more configuration issues without resolving the underlying problem.

In my case, I discovered that my system clock was wrong, and was set before the GitHub.com certificate was supposed to be valid. Fixing the clock resolved the issue without needing to expose my machine to security threats.

rgov
  • 3,516
  • 1
  • 31
  • 51
1

I was getting this error while building a Docker image. The fix was to add the following to my Dockerfile. Be sure to put the call to update-ca-certificates before the git clone call.

RUN apt-get -y install --no-install-recommends ca-certificates \                             
  && update-ca-certificates \
  && git clone whatever
TrojanName
  • 4,853
  • 5
  • 29
  • 41
0

To do your clone without dealing with cert problem this post (disable certification verification) can help you.

Community
  • 1
  • 1
mkebri
  • 2,025
  • 1
  • 16
  • 14
-2

Delete all reference to the SSH certificate from your Github account and validate manually with an e-mail address and password.