diff --git a/tests/unit/discovery/hazelcast_cloud_discovery_test.py b/tests/unit/discovery/hazelcast_cloud_discovery_test.py index d85347f386..d5ace2a861 100644 --- a/tests/unit/discovery/hazelcast_cloud_discovery_test.py +++ b/tests/unit/discovery/hazelcast_cloud_discovery_test.py @@ -73,11 +73,10 @@ class Server: def __init__(self): self.server = HTTPServer((HOST, 0), CloudHTTPHandler) - self.server.socket = ssl.wrap_socket( - self.server.socket, - get_abs_path(self.cur_dir, "key.pem"), - get_abs_path(self.cur_dir, "cert.pem"), - server_side=True, + ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + ssl_context.load_cert_chain("cert.pem", "key.pem") + self.server.socket = ssl_context.wrap_socket( + self.server.socket, server_side=True, ) self.port = self.server.socket.getsockname()[1]