Skip to content

Commit 070beeb

Browse files
fantix1st1
authored andcommitted
enforce TLS<1.3 for SSL renegotiation tests
* fixes #248
1 parent a892ce6 commit 070beeb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_tcp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,6 +2203,8 @@ def test_renegotiation(self):
22032203
sslctx.use_privatekey_file(self.ONLYKEY)
22042204
sslctx.use_certificate_chain_file(self.ONLYCERT)
22052205
client_sslctx = self._create_client_ssl_context()
2206+
if hasattr(ssl, 'OP_NO_TLSv1_3'):
2207+
client_sslctx.options |= ssl.OP_NO_TLSv1_3
22062208

22072209
def server(sock):
22082210
conn = openssl_ssl.Connection(sslctx, sock)
@@ -2560,6 +2562,8 @@ def test_flush_before_shutdown(self):
25602562
sslctx_openssl.use_privatekey_file(self.ONLYKEY)
25612563
sslctx_openssl.use_certificate_chain_file(self.ONLYCERT)
25622564
client_sslctx = self._create_client_ssl_context()
2565+
if hasattr(ssl, 'OP_NO_TLSv1_3'):
2566+
client_sslctx.options |= ssl.OP_NO_TLSv1_3
25632567

25642568
future = None
25652569

0 commit comments

Comments
 (0)