mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-03-28 01:44:17 +08:00
fix ALPN usage
This commit is contained in:
@@ -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 and self.client_conn.connection.get_alpn_proto_negotiated():
|
||||
if self.client_conn.ssl_established and self.client_conn.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.:
|
||||
@@ -512,7 +512,7 @@ class TlsLayer(base.Layer):
|
||||
# * then the first server connection negotiates http/1.1,
|
||||
# * but after the server_conn change, the new host offers h2
|
||||
# * which results in garbage because the layers don' match.
|
||||
alpn = [self.client_conn.connection.get_alpn_proto_negotiated()]
|
||||
alpn = [self.client_conn.get_alpn_proto_negotiated()]
|
||||
|
||||
ciphers_server = self.config.options.ciphers_server
|
||||
if not ciphers_server and self._client_tls:
|
||||
|
||||
Reference in New Issue
Block a user