diff options
| author | Aldo Cortesi <aldo@nullcube.com> | 2014-03-07 16:38:50 +1300 |
|---|---|---|
| committer | Aldo Cortesi <aldo@nullcube.com> | 2014-03-07 16:38:50 +1300 |
| commit | 2a12aa3c47d57cc2d3a36f6726a5f081ca493457 (patch) | |
| tree | f3522a95be2533f893859e940e23383b5591f6df /test | |
| parent | 52b14aa1d1bbeb3e2b8c62ee9939b9575ee1840f (diff) | |
| download | mitmproxy-2a12aa3c47d57cc2d3a36f6726a5f081ca493457.tar.gz mitmproxy-2a12aa3c47d57cc2d3a36f6726a5f081ca493457.tar.bz2 mitmproxy-2a12aa3c47d57cc2d3a36f6726a5f081ca493457.zip | |
Support Ephemeral Diffie-Hellman
Diffstat (limited to 'test')
| -rw-r--r-- | test/data/dhparam.pem | 5 | ||||
| -rw-r--r-- | test/test_tcp.py | 20 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/data/dhparam.pem b/test/data/dhparam.pem new file mode 100644 index 00000000..6f2526e1 --- /dev/null +++ b/test/data/dhparam.pem @@ -0,0 +1,5 @@ +-----BEGIN DH PARAMETERS----- +MIGHAoGBAOdPzMbYgoYfO3YBYauCLRlE8X1XypTiAjoeCFD0qWRx8YUsZ6Sj20W5 +zsfQxlZfKovo3f2MftjkDkbI/C/tDgxoe0ZPbjy5CjdOhkzxn0oTbKTs16Rw8DyK +1LjTR65sQJkJEdgsX8TSi/cicCftJZl9CaZEaObF2bdgSgGK+PezAgEC +-----END DH PARAMETERS----- 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)) |
