jueves, 10 de noviembre de 2011

GIT and self-signed certificates (GIT over HTTPS)

I've seen some people over the internet having problems with GIT repos over HTTPS and self-signed certificates. The GIT gurus explain that as GIT checks the validity of the certificates, you have to tell GIT, somehow, to ignore this check thus allowing you to pull/push from these repos.

The usual way to achieve this is by exporting the GIT_SSL_NO_VERIFY=true. This works for a lot of situations and systems, but there's another way to achieve this behavior. In your .git/config, you can create a new section (if you don't have it already) called http and declare a variable sslVerify and set it to false. Like this:

from .git/config

    sslVerify = false
This way, this particular working copy of the repo won't ever check for valid certificates and you don't have to modify your environment. This is specially useful for Windows devs using repos with Tortoise GIT or  the Visual Studio GIT plugin.

Hope this helps.