From 985213a6bc64422b88deada4b195df5aa37f773d Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sat, 20 Feb 2016 18:52:52 +0100 Subject: [PATCH 1/2] fix tests --- mitmproxy/dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py index d7f076cfd..7b4609b49 100644 --- a/mitmproxy/dump.py +++ b/mitmproxy/dump.py @@ -73,7 +73,7 @@ class DumpMaster(flow.FlowMaster): self.set_stream_large_bodies(options.stream_large_bodies) - if self.server.config.http2 and not tcp.HAS_ALPN: # pragma: no cover + if self.server and self.server.config.http2 and not tcp.HAS_ALPN: # pragma: no cover print("ALPN support missing (OpenSSL 1.0.2+ required)!\n" "HTTP/2 is disabled. Use --no-http2 to silence this warning.", file=sys.stderr) From cf570200383fc4549a81e712a3b2b67870486d16 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 20 Feb 2016 22:08:49 +0100 Subject: [PATCH 2/2] fix proxy reconnect --- mitmproxy/protocol/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/protocol/base.py b/mitmproxy/protocol/base.py index a14066cd1..41d47281f 100644 --- a/mitmproxy/protocol/base.py +++ b/mitmproxy/protocol/base.py @@ -163,7 +163,7 @@ class ServerConnectionMixin(object): self.server_conn.finish() self.server_conn.close() self.channel.tell("serverdisconnect", self.server_conn) - self.server_conn = ServerConnection(address, source_address) + self.server_conn = ServerConnection(address, (source_address.host, 0)) def connect(self): """