binance-connector-python icon indicating copy to clipboard operation
binance-connector-python copied to clipboard

Websocket SSL un expected EOF while reading error

Open tring-malikans opened this issue 2 years ago • 2 comments

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

tring-malikans avatar Jul 16 '22 14:07 tring-malikans

Can you reduce the stream numbers and see it's getting more stable?

2pd avatar Jul 22 '22 11:07 2pd

thank

pongit avatar Jul 25 '22 05:07 pongit

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... ^^

tomw777 avatar Aug 18 '22 13:08 tomw777

Hello. To fix this issue:

import certifi
# FIXME: ("SSL error: unregistered scheme (in )"), code: 1006
os.environ['SSL_CERT_FILE'] = certifi.where()

nolimitech avatar Sep 04 '22 22:09 nolimitech

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 avatar Sep 09 '22 16:09 aisling-2

@aisling-2 nice, the solution solved it thanks

tomw777 avatar Sep 10 '22 13:09 tomw777