From f97406be4c0a02c1501c7ab8bc8ef3850eddb962 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 13 Nov 2020 16:37:52 +0100 Subject: bpo-40968: Send http/1.1 ALPN extension (#20959) Signed-off-by: Christian Heimes --- Lib/urllib/request.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/urllib/request.py') 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: -- cgit v1.2.1