aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/net/test_tcp.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/mitmproxy/net/test_tcp.py')
-rw-r--r--test/mitmproxy/net/test_tcp.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/mitmproxy/net/test_tcp.py b/test/mitmproxy/net/test_tcp.py
index 22a306dc..f204b8b9 100644
--- a/test/mitmproxy/net/test_tcp.py
+++ b/test/mitmproxy/net/test_tcp.py
@@ -37,7 +37,7 @@ class ClientCipherListHandler(tcp.BaseHandler):
sni = None
def handle(self):
- self.wfile.write(str(self.connection.get_cipher_list()).encode())
+ self.wfile.write(f"{self.connection.get_cipher_list()}\n".encode())
self.wfile.flush()
@@ -421,16 +421,18 @@ class TestServerCipherList(tservers.ServerTestBase):
cipher_list='AES256-GCM-SHA384'
)
+ @pytest.mark.xfail
def test_echo(self):
+ # Not working for OpenSSL 1.1.1, see
+ # https://github.com/pyca/pyopenssl/blob/fc802df5c10f0d1cd9749c94887d652fa26db6fb/src/OpenSSL/SSL.py#L1192-L1196
c = tcp.TCPClient(("127.0.0.1", self.port))
with c.connect():
c.convert_to_tls(sni="foo.com")
- expected = b"['AES256-GCM-SHA384']"
- assert c.rfile.read(len(expected) + 2) == expected
+ expected = b"['TLS_AES_256_GCM_SHA384']"
+ assert c.rfile.readline() == expected
class TestServerCurrentCipher(tservers.ServerTestBase):
-
class handler(tcp.BaseHandler):
sni = None
@@ -442,7 +444,10 @@ class TestServerCurrentCipher(tservers.ServerTestBase):
cipher_list='AES256-GCM-SHA384'
)
+ @pytest.mark.xfail
def test_echo(self):
+ # Not working for OpenSSL 1.1.1, see
+ # https://github.com/pyca/pyopenssl/blob/fc802df5c10f0d1cd9749c94887d652fa26db6fb/src/OpenSSL/SSL.py#L1192-L1196
c = tcp.TCPClient(("127.0.0.1", self.port))
with c.connect():
c.convert_to_tls(sni="foo.com")
@@ -608,7 +613,7 @@ class TestDHParams(tservers.ServerTestBase):
def test_dhparams(self):
c = tcp.TCPClient(("127.0.0.1", self.port))
with c.connect():
- c.convert_to_tls()
+ c.convert_to_tls(method=SSL.TLSv1_2_METHOD)
ret = c.get_current_cipher()
assert ret[0] == "DHE-RSA-AES256-SHA"