From 8a8d4d977d713c4a22c45867b2dca287d754b11d Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 21 Dec 2023 13:10:29 +0200 Subject: [PATCH] Correct wrap_socket call for Python 3.12 Signed-off-by: Aarni Koskela --- test/paho_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/paho_test.py b/test/paho_test.py index 65c753d7..86c4274f 100644 --- a/test/paho_test.py +++ b/test/paho_test.py @@ -44,7 +44,8 @@ def create_server_socket_ssl(*args, **kwargs): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - ssock = ssl.wrap_socket( + context = ssl.SSLContext(ssl_version) + ssock = context.wrap_socket( sock, ca_certs="../ssl/all-ca.crt", keyfile="../ssl/server.key", certfile="../ssl/server.crt", server_side=True, ssl_version=ssl_version, **kwargs)