fix: websocket connects send configured headers and enable TLS - #73
Merged
janfeddersen-wq merged 1 commit intoSep 7, 2026
Merged
Conversation
WebSocketConfig::with_auth stored headers that never reached the wire: connect_async received only the URL, so authenticated endpoints rejected every handshake. Build the handshake request explicitly, apply the configured headers to it, and bound the connect with the configured timeout so a hanging endpoint fails fast instead of stalling the caller indefinitely. The websocket feature also refused every wss:// URL with 'TLS support not compiled in' because no TLS backend was enabled behind it. TLS is part of the wss contract rather than an optional extra, so the feature now enables rustls with native root certificates. Verified against tokio-tungstenite 0.30 as upgraded on main. (janfeddersen-wq#66)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #66 per the review there: the
serdes-ai-streamingfixes are independently mergeable, so they ride alone here.What and why
WebSocketStream::connectacceptedwith_auth/with_headerconfiguration but dropped it when building the HTTP upgrade request, so authenticated endpoints (bearer tokens,originator, account headers) silently connected unauthenticated. Headers now go out on the upgrade request.connectcould hang past the configured timeout; it now honors it.wss://failed at connect time. Thewebsocketfeature did not compile TLS in, so everywss://URL died withTLS support not compiled in. The feature now pulls rustls with native roots, matching what the workspace'sreqwestalready links.Applied on top of main's tokio-tungstenite 0.21 → 0.30 bump (#70); the three-way merge was clean and both intents are preserved.
Verification
cargo fmt --all -- --checkcleancargo clippy -p serdes-ai-streaming --all-features --all-targets -- -D warningscleancargo test -p serdes-ai-streaming --all-features: 63 passed / 0 failed, includingwebsocket::tests::configured_headers_reach_handshake_requestcargo check -p serdes-ai --features fullpasses; the changes are additive and break no workspace consumerFixes the transport layer that #66's codex WebSocket client depends on; the client consolidation described in that review follows separately.