Skip to content

fix(llm): pick the rustls crypto provider for WebSockets explicitly - #321

Merged
stippi merged 1 commit into
mainfrom
fix/rustls-crypto-provider
Nov 17, 2026
Merged

stippi merged 1 commit into
mainfrom
fix/rustls-crypto-provider

Conversation

@daniel-kurzynski

Copy link
Copy Markdown
Collaborator

Fixes #319

Problem

Voice mode panicked while opening its WebSocket:

Could not automatically determine the process-level CryptoProvider from Rustls crate features.

reqwest enables rustls' aws-lc-rs provider and GPUI's reqwest fork enables ring. With both compiled in, rustls cannot pick a process-wide default, and tokio-tungstenite builds its TLS config from that default. So every wss:// connect panicked. The Responses API WebSocket used the same API and had the same problem.

Fix

  • New llm::utils::connect_websocket: for wss:// URLs it builds the rustls ClientConfig with aws-lc-rs (the provider reqwest uses for HTTPS). It loads the same roots tokio-tungstenite loaded before: native ones with tls-native-roots, the embedded Mozilla ones with tls-webpki-roots.
  • The realtime transport and the Responses WebSocket client both connect through it.
  • Builds without either TLS feature still compile; wss:// simply isn't available there, as before.

Tests

  • New test secure_connect_does_not_depend_on_a_default_crypto_provider. It compiles both providers in (ring as a dev-dependency) and connects wss:// to a local socket that drops the connection. It panicked with the message from the issue before the fix and returns an error now.
  • cargo fmt, workspace clippy -D warnings, cargo deny check and workspace tests pass. clippy and the new test also pass with the other llm TLS feature combinations.
  • A one-off connect to a real wss:// endpoint completed the handshake with the new config.

reqwest enables rustls' aws-lc-rs provider and GPUI's reqwest fork enables
ring. With both compiled in, rustls cannot choose a process-wide default,
and tokio-tungstenite, which builds its TLS config from that default,
panicked on every wss:// connect. Voice mode never started.

The realtime and Responses WebSocket connections now go through
utils::connect_websocket, which builds the rustls config with aws-lc-rs
(the provider reqwest uses for HTTPS) and the same roots as before.

Fixes #319
@stippi
stippi merged commit 4354f70 into main Nov 17, 2026
8 of 9 checks passed
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

Successfully merging this pull request may close these issues.

Voice mode fails to start due to conflicting Rustls crypto providers

2 participants