Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket error: lws_ssl_client_connect1 #19

Open
lbandy opened this issue May 1, 2021 · 2 comments
Open

Websocket error: lws_ssl_client_connect1 #19

lbandy opened this issue May 1, 2021 · 2 comments

Comments

@lbandy
Copy link

lbandy commented May 1, 2021

Hello,

I compiled everything and can use the REST functions without issues, but I'm struggling to find a solution to getting the websocket examples to work.

Without changing the original code, the connection fails with lws_ssl_client_connect1.
If I add LCCSCF_ALLOW_INSECURE, there are no errors, but no data is received.

Any ideas on how can I debug/fix it?

@dmikushin
Copy link
Owner

Hi @lbandy , the error suggests that secure SSL session could not be established. I won't be surprised that insecure session is not implemented by Binance endpoint at all for obvious reasons. SSL may fail due to general reasons. The first thing to check is that your system clock is synchronized with an NTP server. Secondly, encrypted connections could be disallowed by your company or network provider - check that SSL works for you in general, e.g. GMail web interface.

@Satoshi-Yoda
Copy link

Good day!

Seems like I have a simular? issue: REST works fine, but websockets don't. It fails to connect with events like that:
Firstly happens this:
<binance::Websocket::event_cb> LWS_CALLBACK_GET_THREAD_ID
with result
tid == 1
Then this:
<binance::Websocket::event_cb> LWS_CALLBACK_CLIENT_CONNECTION_ERROR
With

N: LWS: 4.1.4-srcinfo-cache, loglevel 7
N: NET CLI SRV H1 H2 WS IPv6-absent
E: SSL error: unable to get local issuer certificate (preverify_ok=0;err=20;depth=1)

After some googling I found something about "my system did not trust server certificate". Hmm... Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants