hetzner icon indicating copy to clipboard operation
hetzner copied to clipboard

Fix for Python 3.12 (ssl.wrap_socket got removed)

Open fabiant7t opened this issue 9 months ago • 1 comments

ssl.wrap_socket is not available on Python 3.12+:

  File "/some/where/hetzner/util/http.py", line 66, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file,
                ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

The new approach is creating a SSL context and use it to wrap the socket. For backwards compatibility, this is only used when ssl.wrap_socket is not available.

fabiant7t avatar May 21 '24 07:05 fabiant7t