mercurial/sslutil.py
changeset 50633 b73bae3520b8
parent 50632 a2f922825721
child 50951 d718eddf01d9
equal deleted inserted replaced
50632:a2f922825721 50633:b73bae3520b8
   626 
   626 
   627     # In tests, allow insecure ciphers
   627     # In tests, allow insecure ciphers
   628     # Otherwise, use the list of more secure ciphers if found in the ssl module.
   628     # Otherwise, use the list of more secure ciphers if found in the ssl module.
   629     if exactprotocol:
   629     if exactprotocol:
   630         sslcontext.set_ciphers('DEFAULT:@SECLEVEL=0')
   630         sslcontext.set_ciphers('DEFAULT:@SECLEVEL=0')
   631     elif util.safehasattr(ssl, b'_RESTRICTED_SERVER_CIPHERS'):
   631     elif util.safehasattr(ssl, '_RESTRICTED_SERVER_CIPHERS'):
   632         sslcontext.options |= getattr(ssl, 'OP_CIPHER_SERVER_PREFERENCE', 0)
   632         sslcontext.options |= getattr(ssl, 'OP_CIPHER_SERVER_PREFERENCE', 0)
   633         # pytype: disable=module-attr
   633         # pytype: disable=module-attr
   634         sslcontext.set_ciphers(ssl._RESTRICTED_SERVER_CIPHERS)
   634         sslcontext.set_ciphers(ssl._RESTRICTED_SERVER_CIPHERS)
   635         # pytype: enable=module-attr
   635         # pytype: enable=module-attr
   636 
   636