Pulling from Mercurial - certificate error

17,630

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
Share:
17,630
Smashery
Author by

Smashery

Software Engineer. Coder for Trosnoth, a fun multiplayer game written in Python. #SOreadytohelp

Updated on June 05, 2022

Comments

  • Smashery
    Smashery about 2 years

    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?

  • Benbob
    Benbob about 12 years
    You don't need a dummy file, cacerts = with no path will work fine.
  • charybr
    charybr about 8 years
    Thank very much, Keyo! cacerts = with no path worked.
  • Tim Diels
    Tim Diels over 7 years
    @Keyo That disables security checks entirely
  • Captain Whippet
    Captain Whippet over 6 years
    I found that I had to put cacerts =! as per this answer: stackoverflow.com/a/5371180/896559