diff options
author | Maximilian Hils <git@maximilianhils.com> | 2020-04-03 12:05:06 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2020-04-03 12:05:06 +0200 |
commit | 1e3f1b4d2bd7f82dd4ad6879c2beaecdfe209bc8 (patch) | |
tree | afc6a4353a8489cc6aefbed6561a892521eb82e6 /test | |
parent | c1f01cc67c2adca177cd57b40169bf9dd771ac0b (diff) | |
download | mitmproxy-1e3f1b4d2bd7f82dd4ad6879c2beaecdfe209bc8.tar.gz mitmproxy-1e3f1b4d2bd7f82dd4ad6879c2beaecdfe209bc8.tar.bz2 mitmproxy-1e3f1b4d2bd7f82dd4ad6879c2beaecdfe209bc8.zip |
fix tls test on Windows
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_connections.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/mitmproxy/test_connections.py b/test/mitmproxy/test_connections.py index 7c371c1e..ae296631 100644 --- a/test/mitmproxy/test_connections.py +++ b/test/mitmproxy/test_connections.py @@ -199,6 +199,9 @@ class TestClientConnectionTLS: s = socket.create_connection(address) s = ctx.wrap_socket(s, server_hostname=sni) s.send(b'foobar') + # we need to wait for the test to finish successfully before calling .close() on Windows. + # The workaround here is to signal completion by sending data the other way around. + s.recv(3) s.close() threading.Thread(target=client_run).start() @@ -216,6 +219,7 @@ class TestClientConnectionTLS: assert c.sni == sni assert c.tls_established assert c.rfile.read(6) == b'foobar' + c.wfile.send(b"foo") c.finish() sock.close() |