PyOpenSSL

Module for using pyOpenSSL as a TLS backend. This module was relevant before the standard library ssl module supported SNI, but now that we’ve dropped support for Python 2.7 all relevant Python versions support SNI so this module is no longer recommended.

This needs the following packages installed:

However, pyOpenSSL depends on cryptography, so while we use all three directly here we end up having relatively few packages required.

You can install them with the following command:

$ python -m pip install pyopenssl cryptography idna

To activate certificate checking, call 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
urllib3.contrib.pyopenssl.extract_from_urllib3()

Undo monkey-patching by inject_into_urllib3().

Return type:

None

urllib3.contrib.pyopenssl.inject_into_urllib3()

Monkey-patch urllib3 with PyOpenSSL-backed SSL-support.

Return type:

None