Setting Host Fingerprints for Mercurial

To set the host fingerprints for Merucrial, you will need to follow these instructions:

  1. Change to your home directory.
    cd ~
  2. Now type the following which will output a 60 character string:
    $ openssl s_client -connect TheRepositoryURL_:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin
  3. With the 60 character fingerprint string output from step 2, add it to the [hostfingerprint] section ofthe .hgrc file. Example .hgrc:
    [hostfingerprints]
    TheRepositoryURL = 60CharacterString

Example

$ cd ~
$ openssl s_client -connect genpdf.decapod.googlecode.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin

SHA1 Fingerprint=FD:02:92:B1:B3:32:27:F4:7B:40:3D:0A:CA:9E:DD:EE:22:17:52:02
$ vi .hgrc // vi editing session: fingerprint pasted into .hgrc file.

$ cat .hgrc // display contents of .hgrc file.
[hostfingerprints]
genpdf.decapod.googlecode.com = FD:02:92:B1:B3:32:27:F4:7B:40:3D:0A:CA:9E:DD:EE:22:17:52:02

Specifically for Decapod

For Decapod you will need to set the fingerprint for the following repoitories:

  1. genpdf.decapod.googlecode.com
  2. server.decapod.googlecode.com
  3. ui.decapod.googlecode.com

Using the fingerprint string from Step 2 above, the [hostfingerprints] section in the.hgrc file would look like this:

[hostfingerprints]
genpdf.decapod.googlecode.com = F0:F5:F6:C6:25:33:3E:AF:DB:97:72:38:FF:1A:17:F7:B1:CD:CC:83
server.decapod.googlecode.com = F0:F5:F6:C6:25:33:3E:AF:DB:97:72:38:FF:1A:17:F7:B1:CD:CC:83
ui.decapod.googlecode.com = F0:F5:F6:C6:25:33:3E:AF:DB:97:72:38:FF:1A:17:F7:B1:CD:CC:83