mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-02 00:05:27 +00:00
fix tls test on Windows
This commit is contained in:
parent
c1f01cc67c
commit
1e3f1b4d2b
@ -199,6 +199,9 @@ class TestClientConnectionTLS:
|
|||||||
s = socket.create_connection(address)
|
s = socket.create_connection(address)
|
||||||
s = ctx.wrap_socket(s, server_hostname=sni)
|
s = ctx.wrap_socket(s, server_hostname=sni)
|
||||||
s.send(b'foobar')
|
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()
|
s.close()
|
||||||
threading.Thread(target=client_run).start()
|
threading.Thread(target=client_run).start()
|
||||||
|
|
||||||
@ -216,6 +219,7 @@ class TestClientConnectionTLS:
|
|||||||
assert c.sni == sni
|
assert c.sni == sni
|
||||||
assert c.tls_established
|
assert c.tls_established
|
||||||
assert c.rfile.read(6) == b'foobar'
|
assert c.rfile.read(6) == b'foobar'
|
||||||
|
c.wfile.send(b"foo")
|
||||||
c.finish()
|
c.finish()
|
||||||
sock.close()
|
sock.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user