Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for TLS session resumption in HTTPSConnection
Indicate with a simple flag kwarg whether this should be enabled. To test it in the wild, CPython 3.6+ and an SSL ticket/id issuing server is needed. This cannot be tested with current libraries in the repo, as tornado (which is the mock https server) does not seem to work properly with SSL tickets/ids. Below is a way to test it in the real world: import logging from urllib3.connectionpool import connection_from_url logging.basicConfig(level=logging.DEBUG) # example sites that support SSL resumption, at time of writing: urls = [ 'https://www.reddit.com/', 'https://www.twitch.tv/', 'https://twitter.com/', ] for url in urls: conn = connection_from_url(url) # by default, connection is kept alive, # for testing this, it's easier if it isn't: conn.request('GET', '/', headers={'Connection':'close'}) conn.request('GET', '/', headers={'Connection':'close'}) # should see: # DEBUG:urllib3.connection:For <...>: session_reused=True
- Loading branch information
1 parent
fd1ad73
commit af4be67
Showing
5 changed files
with
200 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters