Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sslutil.py @ 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 | 8c1d0fe1f431 |
children | c8ecd96cc357 |
comparison
equal
deleted
inserted
replaced
34774:fd4caf1b23f6 | 34775:17919e9006b9 |
---|---|
184 ciphers = ui.config('hostsecurity', '%s:ciphers' % hostname, ciphers) | 184 ciphers = ui.config('hostsecurity', '%s:ciphers' % hostname, ciphers) |
185 s['ciphers'] = ciphers | 185 s['ciphers'] = ciphers |
186 | 186 |
187 # Look for fingerprints in [hostsecurity] section. Value is a list | 187 # Look for fingerprints in [hostsecurity] section. Value is a list |
188 # of <alg>:<fingerprint> strings. | 188 # of <alg>:<fingerprint> strings. |
189 fingerprints = ui.configlist('hostsecurity', '%s:fingerprints' % hostname, | 189 fingerprints = ui.configlist('hostsecurity', '%s:fingerprints' % hostname) |
190 []) | |
191 for fingerprint in fingerprints: | 190 for fingerprint in fingerprints: |
192 if not (fingerprint.startswith(('sha1:', 'sha256:', 'sha512:'))): | 191 if not (fingerprint.startswith(('sha1:', 'sha256:', 'sha512:'))): |
193 raise error.Abort(_('invalid fingerprint for %s: %s') % ( | 192 raise error.Abort(_('invalid fingerprint for %s: %s') % ( |
194 hostname, fingerprint), | 193 hostname, fingerprint), |
195 hint=_('must begin with "sha1:", "sha256:", ' | 194 hint=_('must begin with "sha1:", "sha256:", ' |