hcpy icon indicating copy to clipboard operation
hcpy copied to clipboard

HCSocket: connect Error: module 'ssl' has no attribute 'wrap_socket'

Open zibous opened this issue 1 year ago • 1 comments

Hi,

Using Python python3.12 get:

connect Error: module 'ssl' has no attribute 'wrap_socket'

def reconnect(self):
        print(now(), "CON:", self.uri)
        self.reset()
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect((self.host, self.port))
        if not self.http:
            sock = sslpsk.wrap_socket(
                sock,
                ssl_version=ssl.PROTOCOL_TLSv1_2,
                ciphers="ECDHE-PSK-CHACHA20-POLY1305",
                psk=self.psk,
            )
        self.ws = websocket.WebSocket()
        self.ws.connect(
            self.uri,
            socket=sock,
            origin="",
        )

Is there any way to solve this ? Thanks

zibous avatar Jun 13 '24 08:06 zibous