From 21a03d56b5551fd9bf3d93b0de8a01b15027803f Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 22 Nov 2016 17:02:37 +0100 Subject: [PATCH] don't set an empty ALPN, refs #1772 --- mitmproxy/proxy/protocol/tls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/proxy/protocol/tls.py b/mitmproxy/proxy/protocol/tls.py index 1cb9b3c25..82c9d0964 100644 --- a/mitmproxy/proxy/protocol/tls.py +++ b/mitmproxy/proxy/protocol/tls.py @@ -503,7 +503,7 @@ class TlsLayer(base.Layer): if alpn and b"h2" in alpn and not self.config.options.http2: alpn.remove(b"h2") - if self.client_conn.ssl_established: + if self.client_conn.ssl_established and self.client_conn.connection.get_alpn_proto_negotiated(): # If the client has already negotiated an ALP, then force the # server to use the same. This can only happen if the host gets # changed after the initial connection was established. E.g.: