Skip to content

lws_service call stuck after upgrading wolfSSL version #3550

@phelpsdc10

Description

@phelpsdc10

Setup Info:
LWS version 4.3.1
WolfSSL verion upgraded from 4.6.0 to 5.7.6
Curl upgraded to 8.17.0

Before upgrade: Linux 32-bit, Windows 32-bit, Windows 64-bit, and Unison wolfssl consuming products have had no issues.
After upgrade: Windows products are not able to finish hello process, as they get "stuck" in lws_service. (IE no return from lws_service, haven't finished stepping through polling etc. yet, additional testing needs to be done with 3rd party device to see if the problem may be self-connection)

Problem:
This is a single-threaded implementation where the same application is connecting to itself (client/server).
The client sends hello and then moves to want to read. The server processes the read, sends server hello, and moves to want to read. It never gets back to the client read. Attempted to do lws_cancel_service on LWS_CALLBACK_SERVER_WRITEABLE but does not appear to be getting there on a step-through.

Steps Taken:
Initially observed that the wolfssl bio_read was sending back SOCKET_ERROR_E on a WSAEWOULDBLOCK for the client which I thought might trigger a failure. I changed this to also send back a -323 on a WSAEWOULDBLOCK instead of SOCKET_ERROR_E but there was no change. All timers were doubled for testing, but this also had no effect. No other changes have been made.

Request:
Was hoping some guidance or enlightenment regarding this iisue could be given.

`02/26/2026 10:10:09 [2026/02/26 10:10:09:8759] N: __lws_lc_tag: ++ [wsi|0|pipe] (1)

02/26/2026 10:10:09 [2026/02/26 10:10:09:8759] N: __lws_lc_tag: ++ [vh|0|system||-1] (1)

02/26/2026 10:10:09 [2026/02/26 10:10:09:8759] N: __lws_lc_tag: ++ [wsisrv|0|adopted] (1)

02/26/2026 10:10:09 [2026/02/26 10:10:09:8759] N: __lws_lc_tag: ++ [vh|1|default||1443] (2)

02/26/2026 10:10:09 [2026/02/26 10:10:09:8759] N: Vhost 'default' using TLS mode

02/26/2026 10:10:09 [2026/02/26 10:10:09:9022] N: SSL ECDH curve 'prime256v1'

02/26/2026 10:10:09 [2026/02/26 10:10:09:9054] N: [vh|1|default||1443]: lws_socket_bind: source ads 0.0.0.0

02/26/2026 10:10:09 [2026/02/26 10:10:09:9054] N: __lws_lc_tag: ++ [wsi|1|listen|default||1443] (2)

02/26/2026 10:10:09 BACNET_SC_INFO_MSG : The Websocket Server Task is attempting Hub Connection during startup.

02/26/2026 10:10:09 BACNET_SC_INFO_MSG : code 12 value 0

02/26/2026 10:10:09 [2026/02/26 10:10:09:9075] N: __lws_lc_tag: ++ [wsicli|0|WS/h1/default/10.21.212.24] (1)

02/26/2026 10:10:09 [2026/02/26 10:10:09:9075] W: lws_plat_set_socket_options_ip: not implemented on windows platform

02/26/2026 10:10:09 [2026/02/26 10:10:09:9085] N: lws_gate_accepts: on = 0

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_new

02/26/2026 10:10:09 wolfSSL Entering ReinitSSL

02/26/2026 10:10:09 wolfSSL Entering SetSSL_CTX

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_options

02/26/2026 10:10:09 WOLFSSL_OP_CIPHER_SERVER_PREFERENCE

02/26/2026 10:10:09 SSL_OP_NO_COMPRESSION: compression not compiled in

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_NewSession

02/26/2026 10:10:09 InitSSL done. return 0 (success)

02/26/2026 10:10:09 wolfSSL_new InitSSL success

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_new InitSSL =, return 0

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_s_socket

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_new

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_new_socket

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_bio

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_set_flags

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_set_flags

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_dtls_set_using_nonblock

02/26/2026 10:10:09 wolfSSL_dtls_set_using_nonblock() is DEPRECATED for non-DTLS use.

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_ex_data

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_CRYPTO_set_ex_data

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_ERR_clear_error

02/26/2026 10:10:09 Error queue turned off, can not clear nodes

02/26/2026 10:10:09 TLS 1.2 or lower

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_connect

02/26/2026 10:10:09 wolfSSL Entering ReinitSSL

02/26/2026 10:10:09 wolfSSL Entering RetrySendAlert

02/26/2026 10:10:09 wolfSSL Entering SendTls13ClientHello

02/26/2026 10:10:09 Adding signature algorithms extension

02/26/2026 10:10:09 Adding supported versions extension

02/26/2026 10:10:09 wolfSSL Entering EccMakeKey

02/26/2026 10:10:09 wolfSSL Leaving EccMakeKey, return 0

02/26/2026 10:10:09 growing output buffer

02/26/2026 10:10:09 PSK Key Exchange Modes extension to write

02/26/2026 10:10:09 Key Share extension to write

02/26/2026 10:10:09 Supported Versions extension to write

02/26/2026 10:10:09 Signature Algorithms extension to write

02/26/2026 10:10:09 Point Formats extension to write

02/26/2026 10:10:09 Supported Groups extension to write

02/26/2026 10:10:09 Encrypt-Then-Mac extension to write

02/26/2026 10:10:09 SNI extension to write

02/26/2026 10:10:09 EMS extension to write

02/26/2026 10:10:09 wolfSSL Entering SslBioSend

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_write

02/26/2026 10:10:09 Shrinking output buffer

02/26/2026 10:10:09 wolfSSL Leaving SendTls13ClientHello, return 0

02/26/2026 10:10:09 connect state: CLIENT_HELLO_SENT

02/26/2026 10:10:09 Server state up to needed state.

02/26/2026 10:10:09 Progressing server state...

02/26/2026 10:10:09 ProcessReply...

02/26/2026 10:10:09 wolfSSL Entering RetrySendAlert

02/26/2026 10:10:09 wolfSSL Entering SslBioReceive

02/26/2026 10:10:09 wolfSSL Entering SslBioReceive

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_BIO_read

02/26/2026 10:10:09 Would block

02/26/2026 10:10:09 wolfSSL error occurred, error = -323

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_get_error

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_get_error, return -323

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_session_reused

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_session_reused, return 0

02/26/2026 10:10:09 [2026/02/26 10:10:09:9457] N: __lws_lc_tag: ++ [wsisrv|1|adopted] (2)

02/26/2026 10:10:09 [2026/02/26 10:10:09:9467] N: lws_gate_accepts: on = 0

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_ERR_clear_error

02/26/2026 10:10:09 Error queue turned off, can not clear nodes

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_new

02/26/2026 10:10:09 wolfSSL Entering ReinitSSL

02/26/2026 10:10:09 wolfSSL Entering SetSSL_CTX

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_options

02/26/2026 10:10:09 WOLFSSL_OP_NO_SSLv2 : wolfSSL does not support SSLv2

02/26/2026 10:10:09 SSL_OP_NO_SSLv3

02/26/2026 10:10:09 WOLFSSL_OP_CIPHER_SERVER_PREFERENCE

02/26/2026 10:10:09 SSL_OP_NO_COMPRESSION: compression not compiled in

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_NewSession

02/26/2026 10:10:09 InitSSL done. return 0 (success)

02/26/2026 10:10:09 wolfSSL_new InitSSL success

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_new InitSSL =, return 0

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_ex_data

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_CRYPTO_set_ex_data

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_fd

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_read_fd

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_set_read_fd, return 1

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_set_write_fd

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_set_write_fd, return 1

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_dtls_set_using_nonblock

02/26/2026 10:10:09 wolfSSL_dtls_set_using_nonblock() is DEPRECATED for non-DTLS use.

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_ERR_clear_error

02/26/2026 10:10:09 Error queue turned off, can not clear nodes

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_accept

02/26/2026 10:10:09 wolfSSL Entering ReinitSSL

02/26/2026 10:10:09 wolfSSL Entering RetrySendAlert

02/26/2026 10:10:09 wolfSSL Entering RetrySendAlert

02/26/2026 10:10:09 Entered embed receive.

02/26/2026 10:10:09 growing input buffer

02/26/2026 10:10:09 Entered embed receive.

02/26/2026 10:10:09 received record layer msg

02/26/2026 10:10:09 got HANDSHAKE

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_get_options

02/26/2026 10:10:09 wolfSSL Entering DoTls13HandShakeMsg

02/26/2026 10:10:09 wolfSSL Entering EarlySanityCheckMsgReceived

02/26/2026 10:10:09 wolfSSL Leaving EarlySanityCheckMsgReceived, return 0

02/26/2026 10:10:09 wolfSSL Entering DoTls13HandShakeMsgType

02/26/2026 10:10:09 processing client hello

02/26/2026 10:10:09 wolfSSL Entering DoTls13ClientHello

02/26/2026 10:10:09 Supported Versions extension received

02/26/2026 10:10:09 Adding signature algorithms extension

02/26/2026 10:10:09 PSK Key Exchange Modes extension received

02/26/2026 10:10:09 Key Share extension received

02/26/2026 10:10:09 Skipping Supported Versions - already processed

02/26/2026 10:10:09 Signature Algorithms extension received

02/26/2026 10:10:09 Point Formats extension received

02/26/2026 10:10:09 Supported Groups extension received

02/26/2026 10:10:09 Encrypt-Then-Mac extension received

02/26/2026 10:10:09 SNI extension received

02/26/2026 10:10:09 Extended Master Secret extension received

02/26/2026 10:10:09 wolfSSL Entering CheckPreSharedKeys

02/26/2026 10:10:09 wolfSSL Entering ALPN_Select

02/26/2026 10:10:09 wolfSSL Entering MatchSuite

02/26/2026 10:10:09 wolfSSL Entering VerifyServerSuite

02/26/2026 10:10:09 Requires AEAD

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_curve_is_disabled

02/26/2026 10:10:09 wolfSSL_curve_is_disabled checking for 23

02/26/2026 10:10:09 wolfSSL Leaving wolfSSL_curve_is_disabled, return 0

02/26/2026 10:10:09 Verified suite validity

02/26/2026 10:10:09 wolfSSL Entering EccMakeKey

02/26/2026 10:10:09 wolfSSL Leaving EccMakeKey, return 0

02/26/2026 10:10:09 Derive Early Secret

02/26/2026 10:10:09 wolfSSL Leaving DoTls13ClientHello, return 0

02/26/2026 10:10:09 wolfSSL Leaving DoTls13HandShakeMsgType(), return 0

02/26/2026 10:10:09 wolfSSL Leaving DoTls13HandShakeMsg, return 0

02/26/2026 10:10:09 Shrinking input buffer

02/26/2026 10:10:09 accept state ACCEPT_CLIENT_HELLO_DONE

02/26/2026 10:10:09 wolfSSL Entering wolfSSL_accept_TLSv13

02/26/2026 10:10:09 wolfSSL Entering ReinitSSL

02/26/2026 10:10:09 wolfSSL Entering RetrySendAlert

02/26/2026 10:10:09 accept state ACCEPT_HELLO_RETRY_REQUEST_DONE

02/26/2026 10:10:09 accept state ACCEPT_FIRST_REPLY_DONE

02/26/2026 10:10:09 accept state ACCEPT_SECOND_REPLY_DONE

02/26/2026 10:10:09 wolfSSL Entering SendTls13ServerHello

02/26/2026 10:10:09 growing output buffer

02/26/2026 10:10:09 Key Share extension to write

02/26/2026 10:10:09 Supported Versions extension to write

02/26/2026 10:10:09 Shrinking output buffer

02/26/2026 10:10:09 wolfSSL Leaving SendTls13ServerHello, return 0

02/26/2026 10:10:09 accept state SERVER_HELLO_SENT

02/26/2026 10:10:09 accept state ACCEPT_THIRD_REPLY_DONE

02/26/2026 10:10:09 wolfSSL Entering EccSharedSecret

02/26/2026 10:10:09 wolfSSL Leaving EccSharedSecret, return 0

02/26/2026 10:10:09 wolfSSL Entering SendTls13EncryptedExtensions

02/26/2026 10:10:09 Supported Groups extension free

02/26/2026 10:10:09 Derive Handshake Secret

02/26/2026 10:10:09 Derive Client Handshake Secret

02/26/2026 10:10:09 Derive Server Handshake Secret

02/26/2026 10:10:09 Derive Client Key

02/26/2026 10:10:09 Derive Server Key

02/26/2026 10:10:09 Derive Client IV

02/26/2026 10:10:09 Derive Server IV

02/26/2026 10:10:09 growing output buffer

02/26/2026 10:10:09 wolfSSL Entering BuildTls13Message

02/26/2026 10:10:09 wolfSSL Entering EncryptTls13

02/26/2026 10:10:09 wolfSSL Leaving BuildTls13Message, return 0

02/26/2026 10:10:09 Shrinking output buffer

02/26/2026 10:10:09 wolfSSL Leaving SendTls13EncryptedExtensions, return 0

02/26/2026 10:10:09 accept state SERVER_EXTENSIONS_SENT

02/26/2026 10:10:09 wolfSSL Entering SendTls13CertificateRequest

02/26/2026 10:10:09 Signature Algorithms extension to free

02/26/2026 10:10:09 growing output buffer

02/26/2026 10:10:09 Signature Algorithms extension to write

02/26/2026 10:10:09 wolfSSL Entering BuildTls13Message

02/26/2026 10:10:09 wolfSSL Entering EncryptTls13

02/26/2026 10:10:09 wolfSSL Leaving BuildTls13Message, return 0

02/26/2026 10:10:09 Shrinking output buffer

02/26/2026 10:10:09 wolfSSL Leaving SendTls13CertificateRequest, return 0

02/26/2026 10:10:09 accept state CERT_REQ_SENT

02/26/2026 10:10:10 wolfSSL Entering SendTls13Certificate

02/26/2026 10:10:10 growing output buffer

02/26/2026 10:10:10 wolfSSL Entering BuildTls13Message

02/26/2026 10:10:10 wolfSSL Entering EncryptTls13

02/26/2026 10:10:10 wolfSSL Leaving BuildTls13Message, return 0

02/26/2026 10:10:10 Shrinking output buffer

02/26/2026 10:10:10 wolfSSL Leaving SendTls13Certificate, return 0

02/26/2026 10:10:10 accept state CERT_SENT

02/26/2026 10:10:10 wolfSSL Entering SendTls13CertificateVerify

02/26/2026 10:10:10 growing output buffer

02/26/2026 10:10:10 Trying ECC private key, RSA didn't work

02/26/2026 10:10:10 Using ECC private key

02/26/2026 10:10:10 wolfSSL Entering EccSign

02/26/2026 10:10:10 wolfSSL Leaving EccSign, return 0

02/26/2026 10:10:10 wolfSSL Entering BuildTls13Message

02/26/2026 10:10:10 wolfSSL Entering EncryptTls13

02/26/2026 10:10:10 wolfSSL Leaving BuildTls13Message, return 0

02/26/2026 10:10:10 Shrinking output buffer

02/26/2026 10:10:10 wolfSSL Leaving SendTls13CertificateVerify, return 0

02/26/2026 10:10:10 accept state CERT_VERIFY_SENT

02/26/2026 10:10:10 wolfSSL Entering SendTls13Finished

02/26/2026 10:10:10 growing output buffer

02/26/2026 10:10:10 Derive Finished Secret

02/26/2026 10:10:10 Derive Finished Secret

02/26/2026 10:10:10 wolfSSL Entering BuildTls13Message

02/26/2026 10:10:10 wolfSSL Entering EncryptTls13

02/26/2026 10:10:10 wolfSSL Leaving BuildTls13Message, return 0

02/26/2026 10:10:10 Derive Master Secret

02/26/2026 10:10:10 Derive Client Traffic Secret

02/26/2026 10:10:10 Derive Server Traffic Secret

02/26/2026 10:10:10 Derive Client Key

02/26/2026 10:10:10 Derive Server Key

02/26/2026 10:10:10 Derive Client IV

02/26/2026 10:10:10 Derive Server IV

02/26/2026 10:10:10 Shrinking output buffer

02/26/2026 10:10:10 wolfSSL Leaving SendTls13Finished, return 0

02/26/2026 10:10:10 accept state ACCEPT_FINISHED_SENT

02/26/2026 10:10:10 accept state TICKET_SENT

02/26/2026 10:10:10 wolfSSL Entering RetrySendAlert

02/26/2026 10:10:10 Entered embed receive.

02/26/2026 10:10:10 WSA embed receive A non-blocking socket operation could not be completed immediately.
: 10035

02/26/2026 10:10:10 wolfSSL error occurred, error = -323

02/26/2026 10:10:10 wolfSSL Entering wolfSSL_get_error

02/26/2026 10:10:10 wolfSSL Leaving wolfSSL_get_error, return -323

02/26/2026 10:11:54 BACNET_SC_INFO_MSG : The BACnet/SC Datalink Task has requested the Websocket Server Task to shut down.`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions