From db527b39eadd5c2b84a423db3f843d46bc141881 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Fri, 6 Dec 2024 11:59:37 -0800 Subject: [PATCH] fixup --- tests/resources/main.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/resources/main.py b/tests/resources/main.py index 55046517d..2372efa22 100644 --- a/tests/resources/main.py +++ b/tests/resources/main.py @@ -1,15 +1,17 @@ import socket import ssl -import os context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) -cwd = os.getcwd() -print("Current dir is {}".format(cwd)) +context.minimum_version = ssl.TLSVersion.TLSv1_3 +context.maximum_version = ssl.TLSVersion.TLSv1_3 context.load_cert_chain('tls13.pem.crt', 'tls13.key') -with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as sock: - sock.bind(('127.0.0.1', 59443)) - sock.listen(5) - with context.wrap_socket(sock, server_side=True) as ssock: - conn, addr = ssock.accept() - print("accepted new conn: {}".format(addr)) +cnt = 0 +while cnt < 2: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as sock: + sock.bind(('127.0.0.1', 59443)) + sock.listen(5) + with context.wrap_socket(sock, server_side=True) as ssock: + conn, addr = ssock.accept() + print("accepted new conn: {}".format(addr)) + cnt = cnt + 1