mercurial/sslutil.py
changeset 34645 75979c8d4572
parent 33494 30f2715be123
child 34647 dacfcdd8b94e
equal deleted inserted replaced
34644:c0a6c19690ff 34645:75979c8d4572
   475                     ui.warn(_(
   475                     ui.warn(_(
   476                         '(see https://mercurial-scm.org/wiki/SecureConnections '
   476                         '(see https://mercurial-scm.org/wiki/SecureConnections '
   477                         'for more info)\n'))
   477                         'for more info)\n'))
   478 
   478 
   479             elif (e.reason == 'CERTIFICATE_VERIFY_FAILED' and
   479             elif (e.reason == 'CERTIFICATE_VERIFY_FAILED' and
   480                 pycompat.osname == 'nt'):
   480                 pycompat.iswindows):
   481 
   481 
   482                 ui.warn(_('(the full certificate chain may not be available '
   482                 ui.warn(_('(the full certificate chain may not be available '
   483                           'locally; see "hg help debugssl")\n'))
   483                           'locally; see "hg help debugssl")\n'))
   484         raise
   484         raise
   485 
   485 
   715     # On Windows, only the modern ssl module is capable of loading the system
   715     # On Windows, only the modern ssl module is capable of loading the system
   716     # CA certificates. If we're not capable of doing that, emit a warning
   716     # CA certificates. If we're not capable of doing that, emit a warning
   717     # because we'll get a certificate verification error later and the lack
   717     # because we'll get a certificate verification error later and the lack
   718     # of loaded CA certificates will be the reason why.
   718     # of loaded CA certificates will be the reason why.
   719     # Assertion: this code is only called if certificates are being verified.
   719     # Assertion: this code is only called if certificates are being verified.
   720     if pycompat.osname == 'nt':
   720     if pycompat.iswindows:
   721         if not _canloaddefaultcerts:
   721         if not _canloaddefaultcerts:
   722             ui.warn(_('(unable to load Windows CA certificates; see '
   722             ui.warn(_('(unable to load Windows CA certificates; see '
   723                       'https://mercurial-scm.org/wiki/SecureConnections for '
   723                       'https://mercurial-scm.org/wiki/SecureConnections for '
   724                       'how to configure Mercurial to avoid this message)\n'))
   724                       'how to configure Mercurial to avoid this message)\n'))
   725 
   725 
   747         return None
   747         return None
   748 
   748 
   749     # / is writable on Windows. Out of an abundance of caution make sure
   749     # / is writable on Windows. Out of an abundance of caution make sure
   750     # we're not on Windows because paths from _systemcacerts could be installed
   750     # we're not on Windows because paths from _systemcacerts could be installed
   751     # by non-admin users.
   751     # by non-admin users.
   752     assert pycompat.osname != 'nt'
   752     assert not pycompat.iswindows
   753 
   753 
   754     # Try to find CA certificates in well-known locations. We print a warning
   754     # Try to find CA certificates in well-known locations. We print a warning
   755     # when using a found file because we don't want too much silent magic
   755     # when using a found file because we don't want too much silent magic
   756     # for security settings. The expectation is that proper Mercurial
   756     # for security settings. The expectation is that proper Mercurial
   757     # installs will have the CA certs path defined at install time and the
   757     # installs will have the CA certs path defined at install time and the