warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.78k stars 1.49k forks source link

Minimal examples are failing in LWS 4.2 #2497

Closed Rajasekhar-topgear closed 2 years ago

Rajasekhar-topgear commented 2 years ago

Hi Experts,

            I am trying to run client and server from the minimal examples. I am getting error "No supported protocol "dumb-increment-protocol" on the server side. Could you please let me know if I am missing anything (OR) suggest me which client & Server examples that I can run. I need to run a secure client and server.
           Please find the complete client logs attached. 

CLIENT::

Location:: libwebsockets-4.2-stable/minimal-examples/ws-client/minimal-ws-client

[root@gautbhat-linuxdev1 build]# ls -l total 2020 -rw-r--r--. 1 root root 12850 Nov 17 04:01 CMakeCache.txt drwxr-xr-x. 5 root root 4096 Nov 17 04:01 CMakeFiles -rw-r--r--. 1 root root 1748 Nov 17 04:01 cmake_install.cmake -rwxr-xr-x. 1 root root 2034868 Nov 17 04:01 lws-minimal-ws-client -rw-r--r--. 1 root root 5894 Nov 17 04:01 Makefile [root@gautbhat-linuxdev1 build]# ./lws-minimal-ws-client -d1151 -s localhost -p 7681 -j

Error:: [2021/11/17 09:53:50:7948] D: _realloc: size 103: lws_tls_session_add_entry [2021/11/17 09:53:50:7949] I: lws_tls_session_new_cb: 0x761d80: [wsicli|0|WS/h1/localhost]: new default_localhost_7681, ttl 7200s (default:1) [2021/11/17 09:53:50:7949] I: lws_tls_session_new_cb: 0x7658c0: [wsicli|0|WS/h1/localhost]: reuse default_localhost_7681, ttl 7200s (default:1) [2021/11/17 09:53:50:7949] D: [wsicli|0|WS/h1/localhost]: SSL_read says -1 [2021/11/17 09:53:50:7949] D: lws_ssl_get_error: 0x753cc0 -1 -> 2 (errno 11) [2021/11/17 09:53:50:7949] D: [wsicli|0|WS/h1/localhost]: ssl err 2 errno 11 [2021/11/17 09:53:50:7949] D: lws_ssl_capable_read: WANT_READ

[2021/11/17 09:53:50:7949] D: lws_buflist_aware_read: [wsicli|0|WS/h1/localhost]: lws_http_client_socket_service: ssl_capable_read -4 [2021/11/17 09:53:50:7950] D: lws_http_client_socket_service: buflist-aware-read 0 -4 [2021/11/17 09:53:50:7950] D: [wsicli|0|WS/h1/localhost]: SSL_read says 0 [2021/11/17 09:53:50:7950] D: lws_ssl_get_error: 0x753cc0 0 -> 6 (errno 0) [2021/11/17 09:53:50:7950] D: [wsicli|0|WS/h1/localhost]: ssl err 6 errno 0 [2021/11/17 09:53:50:7950] D: lws_buflist_aware_read: [wsicli|0|WS/h1/localhost]: lws_http_client_socket_service: ssl_capable_read -1 [2021/11/17 09:53:50:7950] D: lws_buflist_aware_read: SSL_CAPABLE_ERROR [2021/11/17 09:53:50:7950] D: lws_http_client_socket_service: buflist-aware-read -1 -1 [2021/11/17 09:53:50:7950] I: lws_http_client_socket_service: closing conn at LWS_CONNMODE...SERVER_REPLY, [wsicli|0|WS/h1/localhost], state 0x20b [2021/11/17 09:53:50:7950] I: reason: read failed [2021/11/17 09:53:50:7950] E: CLIENT_CONNECTION_ERROR: read failed

SERVER::

Location:: libwebsockets-4.2-stable/minimal-examples/ws-server/minimal-ws-server

[root@gautbhat-linuxdev1 minimal-ws-server]# ls -l total 2036 drwxr-xr-x. 3 root root 4096 Nov 17 09:01 build drwxr-xr-x. 5 root root 4096 Nov 17 08:56 CMakeFiles -rw-r--r--. 1 root root 1742 Nov 17 06:55 cmake_install.cmake -rw-r--r--. 1 root root 700 Jul 12 23:22 CMakeLists.txt -rw-r--r--. 1 root root 2106 Jul 12 23:22 localhost-100y.cert -rw-r--r--. 1 root root 3272 Jul 12 23:22 localhost-100y.key -rwxr-xr-x. 1 root root 2034793 Nov 17 06:55 lws-minimal-ws-server -rw-r--r--. 1 root root 5870 Nov 17 08:56 Makefile -rw-r--r--. 1 root root 3273 Nov 17 09:01 minimal-ws-server.c drwxr-xr-x. 2 root root 4096 Jul 12 23:22 mount-origin -rw-r--r--. 1 root root 3819 Jul 12 23:22 protocol_lws_minimal.c -rw-r--r--. 1 root root 766 Jul 12 23:22 README.md [root@gautbhat-linuxdev1 minimal-ws-server]# vim minimal-ws-server.c [root@gautbhat-linuxdev1 minimal-ws-server]# vim minimal-ws-server.c [root@gautbhat-linuxdev1 minimal-ws-server]# ./lws-minimal-ws-server -s [2021/11/17 09:45:38:4402] U: LWS minimal ws server | visit http://localhost:7681 (-s = use TLS / https) [2021/11/17 09:45:38:4404] U: Server using TLS [2021/11/17 09:45:38:4404] N: LWS: 4.2.1-unknown, loglevel 1031 [2021/11/17 09:45:38:4404] N: NET CLI SRV H1 H2 WS ConMon IPv6-absent [2021/11/17 09:45:38:4405] N: ++ [wsi|0|pipe] (1) [2021/11/17 09:45:38:4406] N: ++ [vh|0|netlink] (1) [2021/11/17 09:45:38:4423] N: ++ [vh|1|localhost||7681] (2) [2021/11/17 09:45:38:4423] N: Vhost 'localhost' using TLS mode [2021/11/17 09:45:38:4431] N: lws_socket_bind: nowsi: source ads 0.0.0.0 [2021/11/17 09:45:38:4431] N: ++ [wsi|1|listen|localhost||7681] (2) [2021/11/17 09:53:50:7734] N: ++ [wsisrv|0|adopted] (1) [2021/11/17 09:53:50:7949] N: No supported protocol "dumb-increment-protocol" [2021/11/17 09:53:50:7952] N: -- [wsisrv|0|adopted] (0) 21.722ms [2021/11/17 09:53:51:8043] N: ++ [wsisrv|1|adopted] (1) [2021/11/17 09:53:51:8201] N: No supported protocol "dumb-increment-protocol" [2021/11/17 09:53:51:8204] N: -- [wsisrv|1|adopted] (0) 16.079ms [2021/11/17 09:53:54:0943] N: ++ [wsisrv|2|adopted] (1) [2021/11/17 09:53:54:1103] N: No supported protocol "dumb-increment-protocol" [2021/11/17 09:53:54:1106] N: -- [wsisrv|2|adopted] (0) 16.288ms [2021/11/17 09:53:57:6550] N: ++ [wsisrv|3|adopted] (1) [2021/11/17 09:53:57:6713] N: No supported protocol "dumb-increment-protocol" [2021/11/17 09:53:57:6715] N: -- [wsisrv|3|adopted] (0) 16.520ms [2021/11/17 09:54:02:0531] N: ++ [wsisrv|4|adopted] (1) [2021/11/17 09:54:02:0693] N: No supported protocol "dumb-increment-protocol" [2021/11/17 09:54:02:0696] N: -- [wsisrv|4|adopted] (0) 16.506ms [2021/11/17 09:54:07:6609] N: ++ [wsisrv|5|adopted] (1) [2021/11/17 09:54:07:6769] N: No supported protocol "dumb-increment-protocol" [2021/11/17 09:54:07:6771] N: -- [wsisrv|5|adopted] (0) 16.269ms ^C[2021/11/17 10:07:31:2084] N: -- [wsi|0|pipe] (1) 21.879min [2021/11/17 10:07:31:2085] N: -- [vh|1|localhost||7681] (1) 21.879min [2021/11/17 10:07:31:2086] N: -- [wsi|1|listen|localhost||7681] (0) 21.879min [2021/11/17 10:07:31:2086] N: -- [vh|0|netlink] (0) 21.879min You have mail in /var/spool/mail/root [root@gautbhat-linuxdev1 minimal-ws-server] client_logs.txt

Thanks, Rajasekhar

lws-team commented 2 years ago

I can't reproduce any such problem on main or v4.3-stable.

Lws release policy is support last stable release, which is v4.3-stable.

https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.release-policy.md