Skip to content
Myr

Merge pull request #1897 from aliles/master

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

Document requirements for SNI support on Python2

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 1371e81, 98b76f4 · Browse files · 2 files+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

2 files+25 added−0 removed

  • other:+25 added−0 removed

2 files+25 added−0 removed

modified:docs/community/faq.rst+23 added
58 unmodified lines
59* Python 3.160* Python 3.261* Python 3.362* PyPy 1.96364What are "hostname doesn't match" errors?65-----------------------------------------6667These errors occur when :ref:`SSL certificate verification <verification>`68fails to match the certificate the server responds with to the hostname69Requests thinks it's contacting. If you're certain the server's SSL setup is70correct (for example, because you can visit the site with your browser) and71you're using Python 2.6 or 2.7, a possible explanation is that you need72Server-Name-Indication.7374`Server-Name-Indication`_, or SNI, is an official extension to SSL where the75client tells the server what hostname it is contacting. This enables `virtual76hosting`_ on SSL protected sites, the server being to able to respond with a77certificate appropriate for the hostname the client is contacting.7879Python3's SSL module includes native support for SNI. This support has not been80back ported to Python2. For information on using SNI with Requests on Python281refer to this `Stack Overflow answer`_.8283.. _`Server-Name-Indication`: https://en.wikipedia.org/wiki/Server_Name_Indication84.. _`virtual hosting`: https://en.wikipedia.org/wiki/Virtual_hosting85.. _`Stack Overflow answer`: https://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support/18579484#18579484
modified:docs/user/advanced.rst+2 added
143 unmodified lines
144 )145146 print(resp.status_code)147148.. _verification:149150SSL Cert Verification151---------------------152153Requests can verify SSL certificates for HTTPS requests, just like a web browser. To check a host's SSL certificate, you can use the ``verify`` argument::
529 unmodified lines