Skip to content

Commit

Permalink
Python 3.12 ssl no longer has the ssl.wrap_socket method but it is …
Browse files Browse the repository at this point in the history
…replaced with the ssl_context usage. The tests fail at 3.12 build without this fix.
  • Loading branch information
ihsandemir committed Jan 3, 2024
1 parent 1e85063 commit 5afca09
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/unit/discovery/hazelcast_cloud_discovery_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 5afca09

Please sign in to comment.