summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2020-11-13 15:37:52 (GMT)
committerGitHub <noreply@github.com>2020-11-13 15:37:52 (GMT)
commitf97406be4c0a02c1501c7ab8bc8ef3850eddb962 (patch)
tree9fe83b52d120269d64fec6e877bb9576124bbd57 /Lib/urllib/request.py
parent09490a109faaee9cc393b52742a8575c116c56ba (diff)
downloadcpython-f97406be4c0a02c1501c7ab8bc8ef3850eddb962.zip
cpython-f97406be4c0a02c1501c7ab8bc8ef3850eddb962.tar.gz
cpython-f97406be4c0a02c1501c7ab8bc8ef3850eddb962.tar.bz2
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.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index a8c870b..39974d9 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: