I have a python program that uses websocket module and WebSocketApp class to connect to the Binance WebSocket API. Here is the code that I use to do this: class WebSocketListener: def __init__( self, url: str = "wss://stream.binance.com:9443/ws/casper" ): self.__websocket = WebSocketApp( url=url, on_open=self.__on_open, on_message=self.__on_message, on_error=self.__on_error, on_close=self.__on_close ) def launch_websocket(self): self.__websocket.run_forever() It used to work just fine until now: I didn't change anything in particular, it just stopped working. I can't launch my program, because I'm constantly getting this error at the start: Status code: 59. message: WebSocket error received: SSL not available.. WebSocketListener.__on_close() missing 2 required positional arguments: 'code' and 'msg' From my callback method: @staticmethod def __on_error(ws: WebSocketApp, exception: Exception): raise CasperError(error={ "msg": f"WebSocket error detected: {exception}", "code": StatusCodes.API_ERROR.value }) Firstly I saw this error while coding this project on linux(in PyCharm IDE), and solution was just to create a new project with its local environment and move all of my scripts there. That was kind of silly but magically the error was gone for a while, until one day it appeared again, and creation of a new project didn't help. Then I decided to create a new project on Windows, but got the same error at the start of my program. Now I don't really know what to do, because Rest API requests work fine, the same as everything else. It seems like something happened to my websocket. Would be grateful for your help. Thank you! Continue reading...