Mercurial > public > mercurial-scm > hg
diff mercurial/sslutil.py @ 37872:51a2f8d199c7
sslutil: fix some edge cases in Python 3 support
Detected by fixing up test-url.py on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D3467
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 27 Apr 2018 00:05:46 -0400 |
parents | 46e705b79323 |
children | 67dc32d4e790 |
line wrap: on
line diff
--- a/mercurial/sslutil.py Thu Apr 26 23:33:27 2018 -0400 +++ b/mercurial/sslutil.py Fri Apr 27 00:05:46 2018 -0400 @@ -640,9 +640,9 @@ return _('no certificate received') dnsnames = [] - san = cert.get('subjectAltName', []) + san = cert.get(r'subjectAltName', []) for key, value in san: - if key == 'DNS': + if key == r'DNS': try: if _dnsnamematch(value, hostname): return @@ -672,6 +672,7 @@ dnsnames.append(value) + dnsnames = [pycompat.bytesurl(d) for d in dnsnames] if len(dnsnames) > 1: return _('certificate is for %s') % ', '.join(dnsnames) elif len(dnsnames) == 1: