Closed jetgem closed 6 years ago
Sorry for the long delay.
I can reproduce it... the situation from lws side is immediately after the connection succeeds, we get a zero-length SSL_read()
[2018/09/22 04:56:13:3799] DEBUG: 0x1139350: SSL_read says 0
RETURN VALUES
The following return values can occur:
> 0
The read operation was successful. The return value is the number of bytes actually read from the TLS/SSL connection.
<= 0
<0
The read operation was not successful, because either the connection was closed, an error occurred or action must be taken by the calling process. Call SSL_get_error with the return value ret to find out the reason.
...
Old documentation indicated a difference between 0 and -1, and that -1 was retryable. You should instead call SSL_get_error() to find out if it's retryable.
https://www.openssl.org/docs/man1.0.2/ssl/SSL_read.html
The reason that comes back is
SSL_ERROR_ZERO_RETURN
The TLS/SSL connection has been closed. If the protocol version is SSL 3.0 or higher, this result code is returned only if a closure alert has occurred in the protocol, i.e. if the connection has been closed cleanly. Note that in this case SSL_ERROR_ZERO_RETURN does not necessarily indicate that the underlying transport has been closed.
https://www.openssl.org/docs/man1.1.0/ssl/SSL_get_error.html
We respond to that by closing the connection too.
I get the same thing without tls... hacking the close response out to confirm it's real or not, it just spins like this
[2018/11/01 08:21:34:4623] INFO: rops_handle_POLLIN_ws: zero length read
So no doubt the other side closed.
I did these tests with a slightly modified (to allow --ssl flag) minimal-ws-client-echo example... that doesn't actually send anything as it is. So it should just stay up silently until the other side times it out.
Lws can talk to itself and talk to browsers with and without tls as you can easily confirm. So without any more info from their server logs, I guess this is a problem their end.
Hi, I was able to connect to ws, but no luck with wss. Can you check what's wrong? I'm using v3-stable branch.
Attached full source and logs.