diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2018-05-01 07:24:53 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2018-05-01 08:47:26 +1200 |
commit | 6d27b28b85b092f5cc933937bdceb9abef8f7efb (patch) | |
tree | c6b15c366e467f18b238ba8121c5eecaca95c75c /mitmproxy/net | |
parent | e8dac2d290e3a7a1b964c766f92b3f65bf72b0ce (diff) | |
download | mitmproxy-6d27b28b85b092f5cc933937bdceb9abef8f7efb.tar.gz mitmproxy-6d27b28b85b092f5cc933937bdceb9abef8f7efb.tar.bz2 mitmproxy-6d27b28b85b092f5cc933937bdceb9abef8f7efb.zip |
client replay: expad and consolidate tests
Diffstat (limited to 'mitmproxy/net')
-rw-r--r-- | mitmproxy/net/tcp.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mitmproxy/net/tcp.py b/mitmproxy/net/tcp.py index 22016291..18429daa 100644 --- a/mitmproxy/net/tcp.py +++ b/mitmproxy/net/tcp.py @@ -372,12 +372,11 @@ class TCPClient(_Connection): # Make sure to close the real socket, not the SSL proxy. # OpenSSL is really good at screwing up, i.e. when trying to recv from a failed connection, # it tries to renegotiate... - if not self.connection: - return - elif isinstance(self.connection, SSL.Connection): - close_socket(self.connection._socket) - else: - close_socket(self.connection) + if self.connection: + if isinstance(self.connection, SSL.Connection): + close_socket(self.connection._socket) + else: + close_socket(self.connection) def convert_to_tls(self, sni=None, alpn_protos=None, **sslctx_kwargs): context = tls.create_client_context( |