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 /netlib | |
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 'netlib')
-rw-r--r-- | netlib/tcp.py | 4 | ||||
-rw-r--r-- | netlib/test.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py index 31e9a398..f1496a32 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -266,7 +266,7 @@ class BaseHandler: self.clientcert = None - def convert_to_ssl(self, cert, key, method=SSLv23_METHOD, options=None, handle_sni=None, request_client_cert=False): + def convert_to_ssl(self, cert, key, method=SSLv23_METHOD, options=None, handle_sni=None, request_client_cert=False, cipher_list=None): """ cert: A certutils.SSLCert object. method: One of SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, or TLSv1_METHOD @@ -294,6 +294,8 @@ class BaseHandler: ctx = SSL.Context(method) if not options is None: ctx.set_options(options) + if cipher_list: + ctx.set_cipher_list(cipher_list) if handle_sni: # SNI callback happens during do_handshake() ctx.set_tlsext_servername_callback(handle_sni) diff --git a/netlib/test.py b/netlib/test.py index 661395c5..139d95bb 100644 --- a/netlib/test.py +++ b/netlib/test.py @@ -66,7 +66,8 @@ class TServer(tcp.TCPServer): method = method, options = options, handle_sni = getattr(h, "handle_sni", None), - request_client_cert = self.ssl["request_client_cert"] + request_client_cert = self.ssl["request_client_cert"], + cipher_list = self.ssl.get("cipher_list", None) ) h.handle() h.finish() |