From d5b3e397e142ae60275fb89ea765423903e99bb6 Mon Sep 17 00:00:00 2001 From: Israel Nir Date: Wed, 21 Aug 2013 13:42:30 +0300 Subject: adding cipher list selection option to BaseHandler --- test/test_tcp.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/test_tcp.py') diff --git a/test/test_tcp.py b/test/test_tcp.py index 318d2abc..8fa151af 100644 --- a/test/test_tcp.py +++ b/test/test_tcp.py @@ -34,6 +34,15 @@ class CertHandler(tcp.BaseHandler): self.wfile.flush() +class ClientCipherListHandler(tcp.BaseHandler): + sni = None + + def handle(self): + print self.connection.get_cipher_list() + self.wfile.write("%s"%self.connection.get_cipher_list()) + self.wfile.flush() + + class DisconnectHandler(tcp.BaseHandler): def handle(self): self.close() @@ -180,6 +189,22 @@ class TestSNI(test.ServerTestBase): assert c.rfile.readline() == "foo.com" +class TestClientCipherList(test.ServerTestBase): + handler = ClientCipherListHandler + 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, + cipher_list = 'RC4-SHA' + ) + def test_echo(self): + c = tcp.TCPClient("127.0.0.1", self.port) + c.connect() + c.convert_to_ssl(sni="foo.com") + assert c.rfile.readline() == "['RC4-SHA']" + + class TestSSLDisconnect(test.ServerTestBase): handler = DisconnectHandler ssl = dict( -- cgit v1.2.3 From 75745cb0af9a9b13d075355524947e70209d484b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 8 Dec 2013 13:04:27 +1300 Subject: Zap stray print in tests. --- test/test_tcp.py | 1 - 1 file changed, 1 deletion(-) (limited to 'test/test_tcp.py') diff --git a/test/test_tcp.py b/test/test_tcp.py index 8fa151af..f45acb00 100644 --- a/test/test_tcp.py +++ b/test/test_tcp.py @@ -38,7 +38,6 @@ class ClientCipherListHandler(tcp.BaseHandler): sni = None def handle(self): - print self.connection.get_cipher_list() self.wfile.write("%s"%self.connection.get_cipher_list()) self.wfile.flush() -- cgit v1.2.3