aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2019-11-12 03:05:35 +0100
committerMaximilian Hils <git@maximilianhils.com>2019-11-23 01:06:23 +0100
commit0f868e992489eee54aadd7afc9a2a7212385f9be (patch)
tree2b456fbecf0273eff60ca601f77064ff06541c65 /test
parentbbb7eb692f58ebfcf2fb3b0d6d20ec6dc60a99de (diff)
downloadmitmproxy-0f868e992489eee54aadd7afc9a2a7212385f9be.tar.gz
mitmproxy-0f868e992489eee54aadd7afc9a2a7212385f9be.tar.bz2
mitmproxy-0f868e992489eee54aadd7afc9a2a7212385f9be.zip
update cryptography
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/net/test_tcp.py15
-rw-r--r--test/mitmproxy/net/test_tls.py2
2 files changed, 11 insertions, 6 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"
diff --git a/test/mitmproxy/net/test_tls.py b/test/mitmproxy/net/test_tls.py
index c4e76bc6..e78564c7 100644
--- a/test/mitmproxy/net/test_tls.py
+++ b/test/mitmproxy/net/test_tls.py
@@ -43,7 +43,7 @@ class TestMasterSecretLogger(tservers.ServerTestBase):
tls.log_master_secret.close()
with open(logfile, "rb") as f:
- assert f.read().count(b"CLIENT_RANDOM") == 2
+ assert f.read().count(b"CLIENT_RANDOM") >= 2
tls.log_master_secret = _logfun