diff options
author | Christian Heimes <christian@python.org> | 2020-11-13 16:37:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 16:37:52 +0100 |
commit | f97406be4c0a02c1501c7ab8bc8ef3850eddb962 (patch) | |
tree | 9fe83b52d120269d64fec6e877bb9576124bbd57 /Lib/urllib/request.py | |
parent | 09490a109faaee9cc393b52742a8575c116c56ba (diff) | |
download | cpython-git-f97406be4c0a02c1501c7ab8bc8ef3850eddb962.tar.gz |
bpo-40968: Send http/1.1 ALPN extension (#20959)
Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index a8c870b977..39974d975e 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -202,6 +202,8 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH, cafile=cafile, capath=capath) + # send ALPN extension to indicate HTTP/1.1 protocol + context.set_alpn_protocols(['http/1.1']) https_handler = HTTPSHandler(context=context) opener = build_opener(https_handler) elif context: |