diff options
author | Omer Katz <omer.drow@gmail.com> | 2020-08-30 18:25:11 +0300 |
---|---|---|
committer | Asif Saif Uddin <auvipy@gmail.com> | 2020-08-31 14:05:09 +0600 |
commit | 98267b667e86aa606daf3f2c514869a5d3a4165c (patch) | |
tree | 4a1852a6ba31d7ed045c3756bb87673bc499ca64 | |
parent | 4ebc8e6aecf113b38cb2af6c19181ee8b319a380 (diff) | |
download | py-amqp-98267b667e86aa606daf3f2c514869a5d3a4165c.tar.gz |
All supported Python versions detect the optimal Python version.
Since we no longer support Python 2.7, this code can be removed.
-rw-r--r-- | amqp/transport.py | 11 | ||||
-rw-r--r-- | t/unit/test_transport.py | 2 |
2 files changed, 1 insertions, 12 deletions
diff --git a/amqp/transport.py b/amqp/transport.py index 98e3049..1c7d49e 100644 --- a/amqp/transport.py +++ b/amqp/transport.py @@ -344,17 +344,6 @@ class SSLTransport(_AbstractTransport): Default `ssl.wrap_socket` method augmented with support for setting the server_hostname field required for SNI hostname header """ - # Setup the right SSL version; default to optimal versions across - # ssl implementations - if ssl_version is None: - # older versions of python 2.7 and python 2.6 do not have the - # ssl.PROTOCOL_TLS defined the equivalent is ssl.PROTOCOL_SSLv23 - # we default to PROTOCOL_TLS and fallback to PROTOCOL_SSLv23 - # TODO: Drop this once we drop Python 2.7 support - if hasattr(ssl, 'PROTOCOL_TLS'): - ssl_version = ssl.PROTOCOL_TLS - else: - ssl_version = ssl.PROTOCOL_SSLv23 opts = { 'sock': sock, diff --git a/t/unit/test_transport.py b/t/unit/test_transport.py index 50807f7..7aa703b 100644 --- a/t/unit/test_transport.py +++ b/t/unit/test_transport.py @@ -620,7 +620,7 @@ class test_SSLTransport: mock_ssl_wrap.assert_called_with(cert_reqs=0, certfile=None, keyfile=None, sock=sock, ca_certs=None, server_side=False, - ciphers=None, ssl_version=2, + ciphers=None, ssl_version=None, suppress_ragged_eofs=True, do_handshake_on_connect=False) |