From 6214c6e185179a9203fae00e48eeee0e43dadd59 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Wed, 24 May 2017 16:17:04 +0200 Subject: [PATCH] fix openssl cipher_list bytes/str deprecation --- mitmproxy/net/tcp.py | 2 +- test/mitmproxy/net/test_tcp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mitmproxy/net/tcp.py b/mitmproxy/net/tcp.py index cdac4cd58..12cf73370 100644 --- a/mitmproxy/net/tcp.py +++ b/mitmproxy/net/tcp.py @@ -502,7 +502,7 @@ class _Connection: # Cipher List if cipher_list: try: - context.set_cipher_list(cipher_list) + context.set_cipher_list(cipher_list.encode()) context.set_tmp_ecdh(OpenSSL.crypto.get_elliptic_curve('prime256v1')) except SSL.Error as v: raise exceptions.TlsException("SSL cipher specification error: %s" % str(v)) diff --git a/test/mitmproxy/net/test_tcp.py b/test/mitmproxy/net/test_tcp.py index 234e8afb5..adf8701a5 100644 --- a/test/mitmproxy/net/test_tcp.py +++ b/test/mitmproxy/net/test_tcp.py @@ -391,7 +391,7 @@ class TestSNI(tservers.ServerTestBase): class TestServerCipherList(tservers.ServerTestBase): handler = ClientCipherListHandler ssl = dict( - cipher_list=b'AES256-GCM-SHA384' + cipher_list='AES256-GCM-SHA384' ) def test_echo(self):