Mercurial > hg
changeset 34775:17919e9006b9
configitems: register the 'hostsecurity.*:fingerprints' config
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Sat, 14 Oct 2017 00:29:31 +0200 |
parents | fd4caf1b23f6 |
children | 48d2b396cf6c |
files | mercurial/configitems.py mercurial/sslutil.py |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/configitems.py Sat Oct 14 00:28:48 2017 +0200 +++ b/mercurial/configitems.py Sat Oct 14 00:29:31 2017 +0200 @@ -483,6 +483,10 @@ default=dynamicdefault, generic=True, ) +coreconfigitem('hostsecurity', '.*:fingerprints$', + default=list, + generic=True, +) coreconfigitem('http_proxy', 'always', default=False, )
--- a/mercurial/sslutil.py Sat Oct 14 00:28:48 2017 +0200 +++ b/mercurial/sslutil.py Sat Oct 14 00:29:31 2017 +0200 @@ -186,8 +186,7 @@ # Look for fingerprints in [hostsecurity] section. Value is a list # of <alg>:<fingerprint> strings. - fingerprints = ui.configlist('hostsecurity', '%s:fingerprints' % hostname, - []) + fingerprints = ui.configlist('hostsecurity', '%s:fingerprints' % hostname) for fingerprint in fingerprints: if not (fingerprint.startswith(('sha1:', 'sha256:', 'sha512:'))): raise error.Abort(_('invalid fingerprint for %s: %s') % (