[Git] Solution for fatal: unable to access: SSL certificate problem: Invalid certificate chain

Tadashi Shigeoka ·  Sat, March 3, 2018

I’ll introduce the solution for when git commands produce errors like fatal: unable to access: ‘https://…’: SSL certificate problem: Invalid certificate chain.

Git | ギット

When the server hosting Git repositories uses SSL self-signed certificates, git commands will produce SSL certificate problem: Invalid certificate chain errors, preventing operations like git clone.

$ git clone https://invalid-ssl.example.com/sample.git
Cloning into 'sample'...
fatal: unable to access 'https://invalid-ssl.example.com/sample.git/': SSL certificate problem: Invalid certificate chain

The solution for SSL certificate problem: Invalid certificate chain errors is to turn off the http.sslVerify setting as follows. However, this makes it less secure, so the proper solution is to set up SSL certificates correctly.

# Set http.sslVerify to false
$ git config --global http.sslVerify false

# After git clone
$ git clone https://invalid-ssl.example.com/sample.git

# Set http.sslVerify back to true
$ git config --global http.sslVerify true

That’s all from the Gemba where I needed to git clone urgently even when SSL certificate problem: Invalid certificate chain errors occur.