diff --git a/mitmproxy/connections.py b/mitmproxy/connections.py index 6d4d648f1..f914c7d27 100644 --- a/mitmproxy/connections.py +++ b/mitmproxy/connections.py @@ -112,9 +112,10 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject): tls_version=None, )) - def convert_to_ssl(self, *args, **kwargs): - super().convert_to_ssl(*args, **kwargs) + def convert_to_ssl(self, cert, *args, **kwargs): + super().convert_to_ssl(cert, *args, **kwargs) self.timestamp_ssl_setup = time.time() + self.mitmcert = cert sni = self.connection.get_servername() if sni: self.sni = sni.decode("idna") diff --git a/mitmproxy/proxy/protocol/tls.py b/mitmproxy/proxy/protocol/tls.py index c174b0033..08ce53d06 100644 --- a/mitmproxy/proxy/protocol/tls.py +++ b/mitmproxy/proxy/protocol/tls.py @@ -465,8 +465,6 @@ class TlsLayer(base.Layer): self.log("Establish TLS with client", "debug") cert, key, chain_file = self._find_cert() - self.client_conn.mitmcert = cert - if self.config.options.add_upstream_certs_to_client_chain: extra_certs = self.server_conn.server_certs else: