mercurial/sslutil.py
changeset 35582 72b91f905065
parent 35369 c8ecd96cc357
child 36745 424994a0adfd
--- a/mercurial/sslutil.py	Fri Dec 29 05:22:06 2017 +0530
+++ b/mercurial/sslutil.py	Fri Dec 29 05:25:27 2017 +0530
@@ -17,6 +17,7 @@
 from .i18n import _
 from . import (
     error,
+    node,
     pycompat,
     util,
 )
@@ -808,9 +809,9 @@
     # If a certificate fingerprint is pinned, use it and only it to
     # validate the remote cert.
     peerfingerprints = {
-        'sha1': hashlib.sha1(peercert).hexdigest(),
-        'sha256': hashlib.sha256(peercert).hexdigest(),
-        'sha512': hashlib.sha512(peercert).hexdigest(),
+        'sha1': node.hex(hashlib.sha1(peercert).digest()),
+        'sha256': node.hex(hashlib.sha256(peercert).digest()),
+        'sha512': node.hex(hashlib.sha512(peercert).digest()),
     }
 
     def fmtfingerprint(s):