Using git with self-signed SSL certifcates

From Wikistix

Trying to use self-signed SSL certificates with git is likely to cause an error like:

sh$ git clone https://fubar.com/fubar.git FuBar
Cloning into 'FuBar'...
fatal: unable to access 'https://fubar.com/fubar.git/': SSL certificate problem: unable to get local issuer certificate

While it's possible to disable SSL certificate validation globally for git:

sh$ git config --global http.sslVerify=false

This leaves you exposed to Man-In-The-Middle attacks. It's easy enough to disable for just the one invocation:

sh$ git -c http.sslVerify=false clone https://...

If possible, it's much better to just tell git to use the right certificate bundle, eg.:

sh$ git config --global http.sslCAinfo /bin/curl-ca-bundle.crt