Skip to content

Document the security extra for SNI support with legacy Python #4825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/user/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,27 @@ If you specify a wrong path or an invalid cert, you'll get a SSLError::
.. warning:: The private key to your local certificate *must* be unencrypted.
Currently, Requests does not support using encrypted keys.

.. _sni-support:

SSL support with old Python versions
------------------------------------

It's possible to enable OpenSSL support & `Server Name Indication (SNI)`_ for old Python
versions (older than 2.7.9 & 3.4.3) by installing a few optional dependencies
using the ``security`` extra::

$ pipenv install requests[security]

This will install PyOpenSSL, its dependencies and setup `urllib3 certificate validation`_
automatically when Requests is imported.

However, it is not required if you're using a recent version of Python with `PEP 476`_.
This is included from Python 2.7.9 and 3.4.3.

.. _`Server Name Indication (SNI)`: https://en.wikipedia.org/wiki/Server_Name_Indication
.. _`urllib3 certificate validation`: https://urllib3.readthedocs.io/en/latest/user-guide.html#certificate-verification-in-python-2
.. _`PEP 476`: https://www.python.org/dev/peps/pep-0476/

.. _ca-certificates:

CA Certificates
Expand Down