Module Expr Str TryExcept body ImportFrom alias ImportFrom alias identifier handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad NameLoad Import alias ImportFrom alias identifier ImportFrom alias alias ImportFrom alias alias Import alias Import alias ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str Str Assign NameStore NameLoad Assign NameStore Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Expr Call AttributeLoad NameLoad attr Dict AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Pass Assign NameStore Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Num TryExcept body Assign NameStore NameLoad Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call NameLoad For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq NameLoad Str body Continue Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad For NameStore NameLoad body If UnaryOpNot Call NameLoad NameLoad NameLoad body Continue For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq Call AttributeLoad NameLoad attr Str body Continue Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body AugAssignAdd AttributeStore NameLoad attr Num Return Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body If BoolOpAnd AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr TupleLoad Num Str body Return Str orelse Raise ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body If CompareEq Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Return Str orelse Raise ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr ListLoad ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Raise Call NameLoad Str orelse Return Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body While NameLoad body TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad AttributeLoad NameLoad attr ListLoad Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Raise Call NameLoad Continue decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd NameLoad UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Num While CompareLt NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad AugAssignAdd NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body If CompareLt AttributeLoad NameLoad attr Num body Return Call AttributeLoad AttributeLoad NameLoad attr attr orelse AugAssignSub AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Return NameLoad If NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Dict Str Str TupleLoad TupleLoad TupleLoad Str AttributeLoad Call AttributeLoad NameLoad attr attr ListComp TupleLoad Str NameLoad comprehension NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body AugAssignAdd AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body If CompareLt AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr orelse AugAssignSub AttributeStore NameLoad attr Num decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Return CompareEq NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index NameLoad If NameLoad body Assign NameStore BoolOpOr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad If BoolOpOr NameLoad NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body Raise Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Assign NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr While NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad ListLoad ListLoad Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Raise Call NameLoad Str Continue ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body Raise Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Break Return Call NameLoad NameLoad NameLoad decorator_list
N/A N/A SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.

This needs the following packages installed:

* pyOpenSSL (tested with 0.13)
* ndg-httpsclient (tested with 0.3.2)
* pyasn1 (tested with 0.1.6)

You can install them with the following command:

    pip install pyopenssl ndg-httpsclient pyasn1

To activate certificate checking, call
:func:`~urllib3.contrib.pyopenssl.inject_into_urllib3` from your Python code
before you begin making HTTP requests. This can be done in a ``sitecustomize``
module, or at any other time before your application begins using ``urllib3``,
like this::

    try:
        import urllib3.contrib.pyopenssl
        urllib3.contrib.pyopenssl.inject_into_urllib3()
    except ImportError:
        pass

Now you can use :mod:`urllib3` as you normally would, and it will support SNI
when the required modules are installed.

Activating this module also has the positive side effect of disabling SSL/TLS
compression in Python 2 (see `CRIME attack`_).

If you want to configure the default list of supported cipher suites, you can
set the ``urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST`` variable.

Module Variables
----------------

:var DEFAULT_SSL_CIPHER_LIST: The list of supported SSL/TLS cipher suites.

.. _sni: https://en.wikipedia.org/wiki/Server_Name_Indication
.. _crime attack: https://en.wikipedia.org/wiki/CRIME_(security_exploit)

 N/A N/A ndg.httpsclient.ssl_peer_verification SUBJ_ALT_NAME_SUPPORT ndg.httpsclient.subj_alt_name SubjectAltName BaseSubjectAltName N/A N/A N/A SyntaxError N/A e N/A N/A N/A ImportError e N/A OpenSSL.SSL pyasn1.codec.der decoder der_decoder pyasn1.type univ constraint socket _fileobject timeout N/A ssl N/A select N/A connection N/A util N/A __all__ N/A inject_into_urllib3 extract_from_urllib3 N/A HAS_SNI SUBJ_ALT_NAME_SUPPORT N/A _openssl_versions N/A N/A ssl PROTOCOL_SSLv23 N/A ssl PROTOCOL_TLSv1 N/A N/A OpenSSL SSL SSLv23_METHOD N/A N/A OpenSSL SSL TLSv1_METHOD N/A N/A N/A N/A N/A _openssl_versions update N/A N/A ssl PROTOCOL_SSLv3 N/A N/A OpenSSL SSL SSLv3_METHOD N/A N/A N/A AttributeError N/A N/A N/A _openssl_verify N/A N/A ssl CERT_NONE N/A ssl CERT_OPTIONAL N/A ssl CERT_REQUIRED N/A N/A OpenSSL SSL VERIFY_NONE N/A N/A OpenSSL SSL VERIFY_PEER N/A N/A N/A OpenSSL SSL VERIFY_PEER N/A N/A OpenSSL SSL VERIFY_FAIL_IF_NO_PEER_CERT N/A DEFAULT_SSL_CIPHER_LIST N/A N/A util ssl_ DEFAULT_CIPHERS N/A SSL_WRITE_BLOCKSIZE 16384 N/A N/A N/A _ memoryview N/A has_memoryview True N/A N/A N/A NameError N/A N/A has_memoryview False N/A orig_util_HAS_SNI N/A util HAS_SNI N/A orig_connection_ssl_wrap_socket N/A connection ssl_wrap_socket inject_into_urllib3 N/A N/A N/A N/A N/A Monkey-patch urllib3 with PyOpenSSL-backed SSL-support. N/A N/A connection ssl_wrap_socket ssl_wrap_socket N/A N/A util HAS_SNI HAS_SNI N/A extract_from_urllib3 N/A N/A N/A N/A N/A Undo monkey-patching by :func:`inject_into_urllib3`. N/A N/A connection ssl_wrap_socket orig_connection_ssl_wrap_socket N/A N/A util HAS_SNI orig_util_HAS_SNI N/A SubjectAltName N/A BaseSubjectAltName N/A N/A ASN.1 implementation for subjectAltNames support N/A sizeSpec N/A N/A N/A univ SequenceOf sizeSpec N/A N/A constraint ValueSizeConstraint 1 1024 N/A get_subj_alt_name N/A N/A peer_cert N/A N/A N/A dns_name N/A N/A N/A SUBJ_ALT_NAME_SUPPORT N/A N/A dns_name N/A general_names N/A SubjectAltName N/A i N/A range N/A N/A peer_cert get_extension_count N/A N/A ext N/A N/A peer_cert get_extension i N/A ext_name N/A N/A ext get_short_name N/A N/A ext_name subjectAltName N/A N/A N/A ext_dat N/A N/A ext get_data N/A decoded_dat N/A N/A der_decoder decode ext_dat asn1Spec general_names N/A name decoded_dat N/A N/A N/A N/A isinstance name SubjectAltName N/A N/A N/A entry N/A range N/A len name N/A N/A component N/A N/A name getComponentByPosition entry N/A N/A N/A N/A component getName dNSName N/A N/A N/A N/A N/A dns_name append N/A str N/A N/A component getComponent N/A dns_name N/A WrappedSocket N/A object N/A N/A API-compatibility wrapper for Python OpenSSL's Connection-class.

    Note: _makefile_refs, _drop() and _reuse() are needed for the garbage
    collector of pypy.
     __init__ N/A N/A self connection socket suppress_ragged_eofs N/A True N/A N/A N/A self connection connection N/A N/A self socket socket N/A N/A self suppress_ragged_eofs suppress_ragged_eofs N/A N/A self _makefile_refs 0 N/A fileno N/A N/A self N/A N/A N/A N/A N/A N/A self socket fileno N/A makefile N/A N/A self mode bufsize N/A -1 N/A N/A N/A self _makefile_refs 1 N/A N/A _fileobject self mode bufsize close True N/A recv N/A N/A self N/A args kwargs N/A N/A N/A N/A data N/A N/A N/A self connection recv args kwargs N/A N/A N/A N/A N/A OpenSSL SSL SysCallError N/A e N/A N/A N/A N/A self suppress_ragged_eofs N/A N/A e args N/A -1 Unexpected EOF N/A N/A N/A N/A N/A N/A N/A N/A OpenSSL SSL ZeroReturnError N/A e N/A N/A N/A N/A N/A N/A self connection get_shutdown N/A N/A OpenSSL SSL RECEIVED_SHUTDOWN N/A N/A N/A N/A N/A N/A N/A N/A OpenSSL SSL WantReadError N/A N/A N/A rd wd ed N/A N/A select select N/A N/A self socket N/A N/A N/A N/A N/A self socket gettimeout N/A N/A rd N/A N/A N/A timeout The read operation timed out N/A N/A N/A N/A self recv args kwargs N/A N/A data N/A settimeout N/A N/A self timeout N/A N/A N/A N/A N/A N/A self socket settimeout timeout N/A _send_until_done N/A N/A self data N/A N/A N/A True N/A N/A N/A N/A N/A N/A N/A self connection send data N/A N/A N/A N/A N/A OpenSSL SSL WantWriteError N/A N/A N/A _ wlist _ N/A N/A select select N/A N/A N/A self socket N/A N/A N/A N/A self socket gettimeout N/A N/A wlist N/A N/A N/A timeout N/A N/A sendall N/A N/A self data N/A N/A N/A N/A has_memoryview N/A N/A isinstance data memoryview N/A N/A data N/A memoryview data N/A total_sent 0 N/A N/A total_sent N/A len data N/A N/A sent N/A N/A self _send_until_done N/A data N/A total_sent N/A total_sent SSL_WRITE_BLOCKSIZE N/A total_sent sent N/A shutdown N/A N/A self N/A N/A N/A N/A N/A N/A self connection shutdown N/A close N/A N/A self N/A N/A N/A N/A N/A self _makefile_refs 1 N/A N/A N/A N/A N/A self connection close N/A N/A N/A self _makefile_refs 1 N/A getpeercert N/A N/A self binary_form N/A False N/A N/A x509 N/A N/A N/A self connection get_peer_certificate N/A N/A x509 N/A N/A x509 N/A binary_form N/A N/A N/A N/A N/A OpenSSL crypto dump_certificate N/A N/A OpenSSL crypto FILETYPE_ASN1 x509 N/A N/A subject subjectAltName N/A N/A N/A commonName N/A N/A N/A x509 get_subject CN N/A N/A DNS value N/A value N/A get_subj_alt_name x509 N/A _reuse N/A N/A self N/A N/A N/A N/A self _makefile_refs 1 N/A _drop N/A N/A self N/A N/A N/A N/A N/A self _makefile_refs 1 N/A N/A N/A N/A self close N/A N/A N/A self _makefile_refs 1 N/A N/A _verify_callback N/A N/A cnx x509 err_no err_depth return_code N/A N/A N/A N/A err_no 0 N/A ssl_wrap_socket N/A N/A sock keyfile certfile cert_reqs ca_certs server_hostname ssl_version ca_cert_dir N/A None None None None None None None N/A N/A ctx N/A N/A N/A OpenSSL SSL Context N/A _openssl_versions N/A ssl_version N/A certfile N/A N/A keyfile N/A keyfile certfile N/A N/A N/A ctx use_certificate_file certfile N/A keyfile N/A N/A N/A N/A ctx use_privatekey_file keyfile N/A N/A cert_reqs N/A ssl CERT_NONE N/A N/A N/A N/A ctx set_verify N/A _openssl_verify N/A cert_reqs _verify_callback N/A N/A ca_certs ca_cert_dir N/A N/A N/A N/A N/A N/A ctx load_verify_locations ca_certs ca_cert_dir N/A N/A N/A N/A N/A OpenSSL SSL Error N/A e N/A N/A N/A N/A ssl SSLError N/A bad ca_certs: %r ca_certs e N/A N/A N/A N/A ctx set_default_verify_paths N/A OP_NO_COMPRESSION 131072 N/A N/A N/A ctx set_options OP_NO_COMPRESSION N/A N/A N/A ctx set_cipher_list DEFAULT_SSL_CIPHER_LIST N/A cnx N/A N/A N/A OpenSSL SSL Connection ctx sock N/A N/A N/A cnx set_tlsext_host_name server_hostname N/A N/A N/A cnx set_connect_state N/A True N/A N/A N/A N/A N/A N/A cnx do_handshake N/A N/A N/A N/A N/A OpenSSL SSL WantReadError N/A N/A N/A rd _ _ N/A N/A select select N/A sock N/A N/A N/A N/A sock gettimeout N/A N/A rd N/A N/A N/A timeout select timed out N/A N/A N/A N/A N/A OpenSSL SSL Error N/A e N/A N/A N/A N/A ssl SSLError N/A bad handshake: %r e N/A N/A N/A WrappedSocket cnx sock N/A