summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2022-06-01 00:15:15 +0100
committerAndrei Zeliankou <zelenkov@nginx.com>2022-06-01 00:15:15 +0100
commit880c8e51c335caa93a62c7cbcfb53391a1d7c54d (patch)
tree791e364879995ad2c1ef3a985dd87be9b8496336
parentaee8b9bfb25df4490d137655d0ce097a6b9706fc (diff)
downloadunit-880c8e51c335caa93a62c7cbcfb53391a1d7c54d.tar.gz
unit-880c8e51c335caa93a62c7cbcfb53391a1d7c54d.tar.bz2
Tests: removed deprecated ssl.PROTOCOL_TLSv1_2 constant.
-rw-r--r--test/test_reconfigure_tls.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/test_reconfigure_tls.py b/test/test_reconfigure_tls.py
index 28a3fc66..0f92a419 100644
--- a/test/test_reconfigure_tls.py
+++ b/test/test_reconfigure_tls.py
@@ -11,6 +11,9 @@ class TestReconfigureTLS(TestApplicationTLS):
@pytest.fixture(autouse=True)
def setup_method_fixture(self):
+ if 'HAS_TLSv1_2' not in dir(ssl) or not ssl.HAS_TLSv1_2:
+ pytest.skip('OpenSSL too old')
+
self.certificate()
assert 'success' in self.conf(
@@ -27,9 +30,9 @@ class TestReconfigureTLS(TestApplicationTLS):
), 'load application configuration'
def create_socket(self):
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
- ctx.verify_mode = ssl.CERT_NONE
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ctx.check_hostname = False
+ ctx.verify_mode = ssl.CERT_NONE
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ssl_sock = ctx.wrap_socket(