binance-connector-python
binance-connector-python copied to clipboard
Websocket SSL un expected EOF while reading error
I have added "certifi" in Windows environment variables.
Getting data for 250 coins/pairs from the "trade streams", it runs good for a few hours then start throwing this error.
Apperently this error is not the same as "certifi error" since I have added the windows variable.
Error message:
WebSocket connection closed: connection was closed uncleanly ("SSL error: unexpected eof while reading (in )"), code: 1006, clean: False, reason: connection was closed uncleanly ("SSL error: unexpected eof while reading (in )") Lost connection to Server. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionLost'>: Connection to the other side was lost in a non-clean fashion. ]. Retrying: 1
Can you reduce the stream numbers and see it's getting more stable?
thank
Hi @2pd , got quite the same error.
WARNING:root:WebSocket connection closed: connection was closed uncleanly ("SSL error: unregistered scheme (in )"), code: 1006, clean: False, reason: connection was closed uncleanly ("SSL error: unregistered scheme (in )") ERROR:root:Lost connection to Server. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly. ].
tried to work my way out from the certifi thingy, nothing to do, won't work. can't get it to work
BTW : go easy on me, new in the python world... ^^
Hello. To fix this issue:
import certifi
# FIXME: ("SSL error: unregistered scheme (in )"), code: 1006
os.environ['SSL_CERT_FILE'] = certifi.where()
Hi @tring-malikans @tomw777, can you try the solution proposed by @nolimitech? In case you have further comments, please feel free to reopen this post.
@aisling-2 nice, the solution solved it thanks