[Libwebsockets] SSL Error on Pong receive

Andy Green andy at warmcat.com
Mon Aug 20 01:49:12 CEST 2018



On 08/02/2018 10:43 AM, Benjamin Faul wrote:
> Hi I am having problems with the ping/pong on my websocket connection. I 
> get the errors below:
> 
> |12:31:54.551534331| { INFO} [LWS_LOG] req pp on wsi 0x55cc9c958400
> |12:31:54.551557159| {DEBUG} [LWS_LOG] __lws_set_timeout: 
> 0x55cc9c958400: 20 secs
> |12:31:54.551566000| {DEBUG} [LWS_LOG] _lws_change_pollfd: wsi 
> 0x55cc9c958400: fd 13 events 1 -> 5
> |12:31:54.551596116| {DEBUG} [LWS_LOG] 0x55cc9c958400: SSL_read says 0

https://www.openssl.org/docs/man1.1.1/man3/SSL_read.html

<= 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(3) 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.


> |12:31:54.551598972| { INFO} [LWS_LOG] rops_handle_POLLIN_ws: 
> LWS_SSL_CAPABLE_ERROR
> |12:31:54.551601308| {DEBUG} [LWS_LOG] 0x55cc9c958400: Close and handled
> |12:31:54.551605277| { INFO} [LWS_LOG] __lws_close_free_wsi: 
> 0x55cc9c958400: caller: close_and_handled
> |12:31:54.551611547| {DEBUG} [LWS_LOG] __lws_close_free_wsi: real 
> just_kill_connection: 0x55cc9c958400 (sockfd 13)
> |12:31:54.551614955| { INFO} [LWS_LOG] lws_same_vh_protocol_remove: 
> removing same prot wsi 0x55cc9c958400
> |12:31:54.551617736| { INFO} [LWS_LOG] have prev 0x55cc9c94a000, setting 
> him to our next (nil)
> |12:31:54.551622723|
> {DEBUG} [LWS_LOG] __remove_wsi_socket_from_fds: wsi=0x55cc9c958400,
> sock=13, fds pos=1, end guy pos=2, endfd=0
> |12:31:54.551630842| {DEBUG} [LWS_LOG] lwsi_set_state(0x55cc9c958400, 
> 0x1000001e)
> |12:31:54.551958658| { INFO} [LWS_LOG] lws_vhost_unbind_wsi: vh default: 
> count_bound_wsi 0
> |12:31:54.551963074| {DEBUG} [LWS_LOG] __lws_free_wsi: 0x55cc9c958400, 
> remaining wsi 1
> 
> The libwebsockets I am using is the latest master as of today (2nd 
> August 2018).
> I am using openSSL 1.1.0g on Ubuntu 18.04
> 
> I have tried the stable version 3.0.0 as well with the same result.
> 
> Any advise would be greatly appreciated!

I can't reproduce this using the minimal examples... can you?

Build latest master, then in one terminal

$ cd minimal-examples/ws-server/minimal-ws-server
$ cmake . && make
$ ./lws-minimal-ws-server -s

He will serve over TLS on localhost:7681.  In another terminal

$ cd minimal-examples/ws-client/minimal-ws-client-ping
$ cmake . && make
$ ./lws-minimal-ws-client-ping --server localhost --port 7681

He will connect to the server in the first window and respond to his 
pings at 10s intervals.

You can also give the client -z to test with zero length pings... no problem

Assuming lws is being the server, what was being the client?

-Andy

> Thanks,
> Ben
> 
> 
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets
> 



More information about the Libwebsockets mailing list