Tests: removed deprecated ssl.PROTOCOL_TLSv1_2 constant.
This commit is contained in:
@@ -11,6 +11,9 @@ class TestReconfigureTLS(TestApplicationTLS):
|
|||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def setup_method_fixture(self):
|
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()
|
self.certificate()
|
||||||
|
|
||||||
assert 'success' in self.conf(
|
assert 'success' in self.conf(
|
||||||
@@ -27,9 +30,9 @@ class TestReconfigureTLS(TestApplicationTLS):
|
|||||||
), 'load application configuration'
|
), 'load application configuration'
|
||||||
|
|
||||||
def create_socket(self):
|
def create_socket(self):
|
||||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
|
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
||||||
ctx.verify_mode = ssl.CERT_NONE
|
|
||||||
ctx.check_hostname = False
|
ctx.check_hostname = False
|
||||||
|
ctx.verify_mode = ssl.CERT_NONE
|
||||||
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
ssl_sock = ctx.wrap_socket(
|
ssl_sock = ctx.wrap_socket(
|
||||||
|
|||||||
Reference in New Issue
Block a user