openssl: SSL_accept SSL_ERROR_WANT_READ
Windows. Non-blocking sockets, Select() method. OpenSSL 1.1.1d.
Server: The server code only. The server is at https://127.0.0.1:8887/ Client: There is no client code, I access the server using the Chrome browser.
The program works normal on the laptop in Chrome.
But on the PC, the very first call to SSL_accept() results in an infinite loop of SSL_ERROR_WANT_READ messages.
Then I try to call SSL_read() to eliminate the SSL_ERROR_WANT_READ error, it returns the “-1 bytes” value. I.e. the call to SSL_read() do not succeed either.
Can it be due to local proxy setup etc?
Question: could you write me the steps to go through to debug this issue?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 34 (17 by maintainers)
Hmm. I’m having a very similar issue with DTLS. I’m just beginning to learn OpenSSL. I’m basing my code off of https://github.com/nplab/DTLS-Examples/blob/master/src/dtls_udp_echo.c
My code (sorry if it’s bad): https://github.com/RotartsiORG/StoneMason/blob/master/src/stms/net/dtls.cpp https://github.com/RotartsiORG/StoneMason/blob/master/include/stms/net/dtls.hpp
I would create a new
DTLSServer, callstart(), and then calltick()in a loop. I would then try to connect withopenssl s_client -comp -dtls1_2 -timeout -async -nbio -debug -msg -verify 5 -connect *myip*:3000 -CAfile ca-pub-cert.pem -cert cli-pub-cert.pem -key cli-priv-key.pem, but in the server I would see:SSL_acceptis returningSSL_ERROR_WANT_READ. At this point, I drop the connection because the docs say that this is a fatal error. Hope this helps.