Git Clone Fails: Server Certificate Verification Failed

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.


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...


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.