diff options
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)) |