Pulling from Mercurial - certificate error

Smashery picture Smashery · Jul 30, 2011 · Viewed 17k times · Source

I was trying to pull from a server, and I get the following error:

C:\Users\User\hg_repo>hg pull
abort: error: _ssl.c:490: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICAT
E:certificate verify failed

I have downloaded the certificate and installed it into Windows' Trusted Root Certification Authorities, but I still get the error. How can I get Mercurial to trust the certificate?

Answer

Smashery picture Smashery · Jul 30, 2011

In your user directory (e.g. C:\Users\ on Vista/Windows 7 or C:\Documents and Settings\ before that), there should be a file called 'mercurial.ini' (or if there isn't, just create an empty file with that name). Append a section to the bottom of that file that looks like this:

[web]
cacerts = C:\the\path\to\the\certificate\file.cer