Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent Connection Failures (Underlying Transport Error - uninitialized (SSL routines)) #1150

Open
BenS1 opened this issue Oct 24, 2024 · 3 comments

Comments

@BenS1
Copy link

BenS1 commented Oct 24, 2024

I've been successfully using WebSocketPP for a while now (Thank you), but recently we changed out Client-Server comms from using long lived connections to using shorter lived connections and since then we've been seeing frequent connection failures.

Looking at the error information on the connection failures we were getting an "Underlying Transport Error". Adding further logging to see the transport error details I see that the transport error details are "uninitialized (SSL routines)" (Error 167772436).

If we keep retrying the connection then it eventually succeeds.

Note that a Wireshark capture suggests that nothing is actually happening on the network when these failures occur.

Is this a known problem, or can you think of anything I may be doing wrong?

TY
Ben
P.S. this in on version 0.8.1. I don't see anything in the 0.8.2 release notes that suggests any fixes in this area though, but I'll try it anyway.

@BenS1
Copy link
Author

BenS1 commented Oct 30, 2024

I upgraded to 0.8.2 but it didn't resolve the issue.

I added some detailed logging, but it still doesn't show an obvious cause of the problem:

Thread Message
[1B60] WebSocketPP (Access) - DEVEL endpoint constructor
[1B60] WebSocketPP (Access) - DEVEL client constructor
[1B60] WebSocketPP (Access) - DEVEL set_open_handler
[1B60] WebSocketPP (Access) - DEVEL set_fail_handler
[1B60] WebSocketPP (Access) - DEVEL set_close_handler
[1B60] WebSocketPP (Access) - DEVEL set_message_handler
[1B60] WebSocket(0-1-0)::WebSocket - Creating Web Socket
[1B60] WebSocketClientConn(0-1-0)::Connect - Attempting to Connect to WebSocket Server 'wss://mywebsite.com/myendpoint'
[1B60] WebSocketPP (Access) - DEVEL create_connection
[1B60] WebSocketPP (Access) - DEVEL connection constructor
[461C] WebSocketClientConn(0-1-0)::ProcessingThread - Processing Thread Started
[461C] WebSocketPP (Access) - FAIL WebSocket Connection Unknown - "" /myendpoint 0 websocketpp.transport:2 Underlying Transport Error
[461C] WebSocketPP - ERROR handle_connect error: Underlying Transport Error
[461C] WebSocketPP - DEVEL handle_terminate error: websocketpp.transport:11 (Generic TLS related error)
[461C] WebSocketClientConn(0-1-0)::OnConnectionFailed - Failed to Connect to Server 'wss://mywebsite.com/myendpoint'

Any assistance would be greatly appreciated.

Kind Regards
Ben

@BenS1
Copy link
Author

BenS1 commented Oct 30, 2024

Just to add, I'm using Boost 1.79 and OpenSSL 3.0.15... are there any know issues with these? I don't see any documentation for which versions of these component WebSocketPP supports.

@BenS1
Copy link
Author

BenS1 commented Oct 31, 2024

Ok I managed to reproduce the issue by using a domain name that doesn't resolve!

image

Note that the log messages highlighted in the red box above make it clear what the problem is, but these messages seem to be output directly to stdout/stderr and do not go through the WebSocketPP logging interface. In my actual application I use the WebSocketPP logging interface to store the logs in a file, and hence it's not picking up these 2 messages,

Without these 2 messages it's definitely not clear what the problem is.

Is there a reason that these messages are not sent through the logging interface? This seems like a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant