Skip to content

Instantly share code, notes, and snippets.

@rponte
Last active August 2, 2023 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rponte/e2524e319cd4d17f9072a3347b1a6aaa to your computer and use it in GitHub Desktop.
Save rponte/e2524e319cd4d17f9072a3347b1a6aaa to your computer and use it in GitHub Desktop.
Git clone and SSL certificate problem: "unable to get local issuer certificate" and "server certificate verification failed. CAfile: none CRLfile: none"

The issue with SSL certificate

Just out of the blue, I started getting this issue ("server certificate verification failed. CAfile: none CRLfile: none") while trying to clone any Github repository on Linux (WSL2):

git clone https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git
Cloning into 'preventing-lost-update-racecondition'...
fatal: unable to access 'https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git/': server certificate verification failed. CAfile: none CRLfile: none

And also with Window 11 I got "SSL certificate problem: unable to get local issuer certificate":

git clone https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git
Cloning into 'preventing-lost-update-racecondition'...
fatal: unable to access 'https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git/': SSL certificate problem: unable to get local issuer certificate

How to fix it

I fixed that with these approaches below:

  1. Disabling SSL check (worked on Linux and Windows 11):
git config --global http.sslVerify false
  1. Changing the Secure Channel to schannel instead of openssl (worked on Windows 11):
git config --global http.sslBackend schannel

And we can see all the current Git config with this command:

git config -l --show-origin