summaryrefslogtreecommitdiff
path: root/Lib/http/client.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2020-11-13 16:37:52 +0100
committerGitHub <noreply@github.com>2020-11-13 16:37:52 +0100
commitf97406be4c0a02c1501c7ab8bc8ef3850eddb962 (patch)
tree9fe83b52d120269d64fec6e877bb9576124bbd57 /Lib/http/client.py
parent09490a109faaee9cc393b52742a8575c116c56ba (diff)
downloadcpython-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/http/client.py')
-rw-r--r--Lib/http/client.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 15abcfeada..a54679cf84 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -1407,6 +1407,9 @@ else:
self.cert_file = cert_file
if context is None:
context = ssl._create_default_https_context()
+ # send ALPN extension to indicate HTTP/1.1 protocol
+ if self._http_vsn == 11:
+ context.set_alpn_protocols(['http/1.1'])
# enable PHA for TLS 1.3 connections if available
if context.post_handshake_auth is not None:
context.post_handshake_auth = True