Skip to content
Myr

Document requirements for SNI support on Python2

Before adoption: this commit came in with the history the project adopted, so no landing records it.

A section for Request's advanced usage guide on what Server Name Indication is, its purpose, and how to enable it on Python2.

authored by Aaron Iles · committed by Aaron Iles · parent c608470 · Browse files · 1 file+25 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+25 added−0 removed

  • other:+25 added−0 removed

1 file+25 added−0 removed

modified:docs/user/advanced.rst+25 added
177 unmodified lines
178179 >>> requests.get('https://kennethreitz.com', cert='/wrong_path/server.pem')180 SSLError: [Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib181182Server Name Indication183----------------------184185`Server Name Indication`_, or SNI, is an official extension to SSL where the186client tells the server what hostname it is contacting. This enables `virtual187hosting`_ on SSL protected sites.188189Python3's SSL module includes native support for SNI. This support has not been190back ported to Python2. However, Requests will enable SNI support on Python2 if191the following packages are installed:192193* `pyOpenSSL`_, a Python wrapper module around the OpenSSL library.194* `ndg-httpsclient`_, enhanced HTTPS support for httplib and urllib2.195* `pyasn1`_, ASN.1 types and codecs.196197When these packages are installed, Requests will automatically indicate to the198server what hostname is being contacted. This allows the server to return the199correct server certificate for SSL certificate verification.200201.. _`Server Name Indication`: https://en.wikipedia.org/wiki/Server_Name_Indication202.. _`virtual hosting`: https://en.wikipedia.org/wiki/Virtual_hosting203.. _`pyOpenSSL`: https://pypi.python.org/pypi/pyOpenSSL204.. _`ndg-httpsclient`: https://pypi.python.org/pypi/ndg-httpsclient205.. _`pyasn1`: https://pypi.python.org/pypi/pyasn1206207208Body Content Workflow209---------------------210211By default, when you make a request, the body of the response is downloaded
494 unmodified lines