diff options
author | Israel Nir <israel@Israel-Nirs-MacBook-Pro.local> | 2013-08-21 13:42:30 +0300 |
---|---|---|
committer | Israel Nir <israel@Israel-Nirs-MacBook-Pro.local> | 2013-08-21 13:42:30 +0300 |
commit | d5b3e397e142ae60275fb89ea765423903e99bb6 (patch) | |
tree | 51143016a32979d9419c5a9d35fbc380b5b1955d /test/test_tcp.py | |
parent | 0fed8dc8eb2440a35b5ce95ba7e7360441ff677c (diff) | |
download | mitmproxy-d5b3e397e142ae60275fb89ea765423903e99bb6.tar.gz mitmproxy-d5b3e397e142ae60275fb89ea765423903e99bb6.tar.bz2 mitmproxy-d5b3e397e142ae60275fb89ea765423903e99bb6.zip |
adding cipher list selection option to BaseHandler
Diffstat (limited to 'test/test_tcp.py')
-rw-r--r-- | test/test_tcp.py | 25 |
1 files changed, 25 insertions, 0 deletions
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( |