def create_urllib3_context(ssl_version=None, cert_reqs=None, options=None, ciphers=None):
 context = SSLContext((ssl_version or ssl.PROTOCOL_SSLv23))
 cert_reqs = (ssl.CERT_REQUIRED if (cert_reqs is None) else cert_reqs)
 if (options is None):
  options = 0
  options |= OP_NO_SSLv2
  options |= OP_NO_SSLv3
  options |= OP_NO_COMPRESSION
 context.options |= options
 if getattr(context, 'supports_set_ciphers', True):
  context.set_ciphers((ciphers or DEFAULT_CIPHERS))
 context.verify_mode = cert_reqs
 if (getattr(context, 'check_hostname', None) is not None):
  context.check_hostname = False
 return context

def create_urllib3_context ( ssl_version = None , cert_reqs = None , options = None , ciphers = None ) : context = SSLContext ( ( ssl_version or ssl . PROTOCOL_SSLv23 ) ) cert_reqs = ( ssl . CERT_REQUIRED if ( cert_reqs is None ) else cert_reqs ) if ( options is None ) : options = 0 options |= OP_NO_SSLv2 options |= OP_NO_SSLv3 options |= OP_NO_COMPRESSION context . options |= options if getattr ( context , 'supports_set_ciphers' , True ) : context . set_ciphers ( ( ciphers or DEFAULT_CIPHERS ) ) context . verify_mode = cert_reqs if ( getattr ( context , 'check_hostname' , None ) is not None ) : context . check_hostname = False return context
all arguments have the same meaning as ssl_wrap_socket .