aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_tcp.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-03-07 16:38:50 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-03-07 16:38:50 +1300
commit2a12aa3c47d57cc2d3a36f6726a5f081ca493457 (patch)
treef3522a95be2533f893859e940e23383b5591f6df /test/test_tcp.py
parent52b14aa1d1bbeb3e2b8c62ee9939b9575ee1840f (diff)
downloadmitmproxy-2a12aa3c47d57cc2d3a36f6726a5f081ca493457.tar.gz
mitmproxy-2a12aa3c47d57cc2d3a36f6726a5f081ca493457.tar.bz2
mitmproxy-2a12aa3c47d57cc2d3a36f6726a5f081ca493457.zip
Support Ephemeral Diffie-Hellman
Diffstat (limited to 'test/test_tcp.py')
-rw-r--r--test/test_tcp.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_tcp.py b/test/test_tcp.py
index d5d11294..814754cd 100644
--- a/test/test_tcp.py
+++ b/test/test_tcp.py
@@ -363,6 +363,26 @@ class TestSSLTimeOut(test.ServerTestBase):
tutils.raises(tcp.NetLibTimeout, c.rfile.read, 10)
+class TestDHParams(test.ServerTestBase):
+ handler = HangHandler
+ ssl = dict(
+ cert = tutils.test_data.path("data/server.crt"),
+ key = tutils.test_data.path("data/server.key"),
+ request_client_cert = False,
+ v3_only = False,
+ dhparams = certutils.CertStore.load_dhparam(
+ tutils.test_data.path("data/dhparam.pem"),
+ ),
+ cipher_list = "DHE-RSA-AES256-SHA"
+ )
+ def test_dhparams(self):
+ c = tcp.TCPClient(("127.0.0.1", self.port))
+ c.connect()
+ c.convert_to_ssl()
+ ret = c.get_current_cipher()
+ assert ret[0] == "DHE-RSA-AES256-SHA"
+
+
class TestTCPClient:
def test_conerr(self):
c = tcp.TCPClient(("127.0.0.1", 0))