mercurial/sslutil.py
branchstable
changeset 49384 4a1f0bc0713e
parent 49383 be3828081624
child 50341 698ffff7024b
equal deleted inserted replaced
49383:be3828081624 49384:4a1f0bc0713e
   544         if f and not os.path.exists(f):
   544         if f and not os.path.exists(f):
   545             raise error.Abort(
   545             raise error.Abort(
   546                 _(b'referenced certificate file (%s) does not exist') % f
   546                 _(b'referenced certificate file (%s) does not exist') % f
   547             )
   547             )
   548 
   548 
   549     if util.safehasattr(ssl, 'PROTOCOL_TLS_SERVER'):
   549     if util.safehasattr(ssl, 'TLSVersion'):
   550         # python 3.7+
   550         # python 3.7+
   551         sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
   551         sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
   552         sslcontext.options |= getattr(ssl, 'OP_NO_COMPRESSION', 0)
   552         sslcontext.options |= getattr(ssl, 'OP_NO_COMPRESSION', 0)
   553 
   553 
   554         # This config option is intended for use in tests only. It is a giant
   554         # This config option is intended for use in tests only. It is a giant