changeset 34748:8c1d0fe1f431

configitems: register the 'hostfingerprints' section
author Boris Feld <boris.feld@octobus.net>
date Thu, 12 Oct 2017 00:20:41 +0200
parents 5cf98daad7b1
children acdc574cb8d7
files mercurial/configitems.py mercurial/sslutil.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/configitems.py	Thu Oct 12 00:19:12 2017 +0200
+++ b/mercurial/configitems.py	Thu Oct 12 00:20:41 2017 +0200
@@ -454,6 +454,10 @@
     default=dynamicdefault,
     generic=True,
 )
+coreconfigitem('hostfingerprints', '.*',
+    default=list,
+    generic=True,
+)
 coreconfigitem('hostsecurity', 'ciphers',
     default=None,
 )
--- a/mercurial/sslutil.py	Thu Oct 12 00:19:12 2017 +0200
+++ b/mercurial/sslutil.py	Thu Oct 12 00:20:41 2017 +0200
@@ -200,7 +200,7 @@
         s['certfingerprints'].append((alg, fingerprint))
 
     # Fingerprints from [hostfingerprints] are always SHA-1.
-    for fingerprint in ui.configlist('hostfingerprints', hostname, []):
+    for fingerprint in ui.configlist('hostfingerprints', hostname):
         fingerprint = fingerprint.replace(':', '').lower()
         s['certfingerprints'].append(('sha1', fingerprint))
         s['legacyfingerprint'] = True