requests / toolbelt

A toolbelt of useful classes and functions to be used with python-requests
https://toolbelt.readthedocs.org
Other
999 stars 186 forks source link

Set SNI to Host header in HostHeaderSSLAdapter #293

Closed qistoph closed 1 year ago

qistoph commented 4 years ago

Modern TLS/SSL servers can serve content and certificates based on the Server Name Indication (SNI) that is sent in the Client Hello. By setting the server_hostname in the connection pool arguments, the underlying libraries will send the provided hostname as SNI. This allows us to use the HostHeaderSSLAdapter to request content from a specific IP address, while still requesting the server to sent content based on a hostname.

qistoph commented 4 years ago

Just noticed another PR (https://github.com/requests/toolbelt/pull/278) mentioning the same issue.

Though I think my contribution is a little more complete (doc update and safety setting on line 43).

half-duplex commented 2 years ago

Fixes #159