codex - ✅(Solved) Fix codex --remote wss://... panics with rustls CryptoProvider error [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17283Fetched 2026-04-10 03:43:06
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×3closed ×1commented ×1cross-referenced ×1

Error Message

When using codex --remote against a secure remote app-server endpoint over wss://, the CLI panics immediately with a rustls CryptoProvider error instead of connecting.

Fix Action

Fix / Workaround

I also locally patched the repo and confirmed the issue is in the secure remote client path.

Minimal patch:

and the patched crate tests passed locally.

PR fix notes

PR #17288: Install rustls provider for remote websocket client

Description (problem / solution / changelog)

Addresses #17283

Problem: codex --remote wss://... could panic because app-server-client did not install rustls' process-level crypto provider before opening TLS websocket connections.

Solution: Add the existing rustls provider utility dependency and install it before the remote websocket connect.

Changed files

  • codex-rs/Cargo.lock (modified, +1/-0)
  • codex-rs/app-server-client/Cargo.toml (modified, +1/-0)
  • codex-rs/app-server-client/src/remote.rs (modified, +2/-0)

Code Example

Could not automatically determine the process-level CryptoProvider from Rustls crate features.
Call CryptoProvider::install_default() before this point to select a provider manually, or make sure exactly one of the 'aws-lc-rs' and 'ring' features is enabled.

---

codex app-server \
     --listen ws://127.0.0.1:4222 \
     --ws-auth capability-token \
     --ws-token-file /Users/example/.codex/app-server/ws-token

---

tailscale funnel --bg --yes http://127.0.0.1:4222

---

tailscale funnel status

---

https://example-device.example-tailnet.ts.net

---

export CODEX_REMOTE_AUTH_TOKEN="$(cat /Users/example/.codex/app-server/ws-token)"

---

codex --remote ws://127.0.0.1:4222 --remote-auth-token-env CODEX_REMOTE_AUTH_TOKEN

---

codex --remote wss://example-device.example-tailnet.ts.net:443 --remote-auth-token-env CODEX_REMOTE_AUTH_TOKEN

---

diff --git a/codex-rs/app-server-client/Cargo.toml b/codex-rs/app-server-client/Cargo.toml
@@
 codex-feedback = { workspace = true }
 codex-protocol = { workspace = true }
+codex-utils-rustls-provider = { workspace = true }

diff --git a/codex-rs/app-server-client/src/remote.rs b/codex-rs/app-server-client/src/remote.rs
@@
 use codex_app_server_protocol::ServerNotification;
 use codex_app_server_protocol::ServerRequest;
+use codex_utils_rustls_provider::ensure_rustls_crypto_provider;
@@
         if let Some(auth_token) = args.auth_token.as_deref() {
             ...
         }
+        ensure_rustls_crypto_provider();
         let stream = timeout(CONNECT_TIMEOUT, connect_async(request))

---

just fmt
cargo test -p codex-app-server-client
cargo build -p codex-cli --bin codex
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.118.0

What subscription do you have?

Plus

Which model were you using?

N/A

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Zed integrated terminal

What issue are you seeing?

When using codex --remote against a secure remote app-server endpoint over wss://, the CLI panics immediately with a rustls CryptoProvider error instead of connecting.

The same app-server works correctly over local ws://127.0.0.1:4222, and the same remote endpoint is reachable over wss:// through Tailscale Funnel.

Crash output:

Could not automatically determine the process-level CryptoProvider from Rustls crate features.
Call CryptoProvider::install_default() before this point to select a provider manually, or make sure exactly one of the 'aws-lc-rs' and 'ring' features is enabled.

This appears to be a CLI remote-client bug in the secure websocket path, not an app-server or tunnel issue.

What steps can reproduce the bug?

  1. Create a websocket auth token file for app-server.
  2. Start app-server locally:
    codex app-server \
      --listen ws://127.0.0.1:4222 \
      --ws-auth capability-token \
      --ws-token-file /Users/example/.codex/app-server/ws-token
  3. Expose that local port through Tailscale Funnel:
    tailscale funnel --bg --yes http://127.0.0.1:4222
  4. Confirm the public endpoint is live:
    tailscale funnel status
    Example hostname:
    https://example-device.example-tailnet.ts.net
  5. Set the auth token env var:
    export CODEX_REMOTE_AUTH_TOKEN="$(cat /Users/example/.codex/app-server/ws-token)"
  6. Run the local test, which works:
    codex --remote ws://127.0.0.1:4222 --remote-auth-token-env CODEX_REMOTE_AUTH_TOKEN
  7. Run the secure remote test, which crashes:
    codex --remote wss://example-device.example-tailnet.ts.net:443 --remote-auth-token-env CODEX_REMOTE_AUTH_TOKEN

What is the expected behavior?

codex --remote wss://... should connect successfully to the remote app-server, just as codex --remote ws://127.0.0.1:4222 does locally.

It should not panic during secure websocket setup.

Additional information

I verified that the remote endpoint itself is healthy and that this is not a server-side auth/tunnel problem:

  • GET /readyz and GET /healthz over the Funnel hostname both returned 200
  • A manual websocket upgrade probe to the Funnel hostname returned 101 Switching Protocols
  • The Authorization: Bearer <token> header was accepted by app-server
  • Local ws://127.0.0.1:4222 remote mode works

I also locally patched the repo and confirmed the issue is in the secure remote client path.

Local fix that removes the panic:

  • add codex-utils-rustls-provider as a dependency to codex-app-server-client
  • call ensure_rustls_crypto_provider() before connect_async(request) in codex-rs/app-server-client/src/remote.rs

Minimal patch:

diff --git a/codex-rs/app-server-client/Cargo.toml b/codex-rs/app-server-client/Cargo.toml
@@
 codex-feedback = { workspace = true }
 codex-protocol = { workspace = true }
+codex-utils-rustls-provider = { workspace = true }

diff --git a/codex-rs/app-server-client/src/remote.rs b/codex-rs/app-server-client/src/remote.rs
@@
 use codex_app_server_protocol::ServerNotification;
 use codex_app_server_protocol::ServerRequest;
+use codex_utils_rustls_provider::ensure_rustls_crypto_provider;
@@
         if let Some(auth_token) = args.auth_token.as_deref() {
             ...
         }
+        ensure_rustls_crypto_provider();
         let stream = timeout(CONNECT_TIMEOUT, connect_async(request))

I ran:

just fmt
cargo test -p codex-app-server-client
cargo build -p codex-cli --bin codex

and the patched crate tests passed locally.

extent analysis

TL;DR

The most likely fix is to add the codex-utils-rustls-provider dependency and call ensure_rustls_crypto_provider() before connecting to the remote app-server over a secure websocket.

Guidance

  • The issue seems to be related to the secure websocket setup in the codex-cli when using --remote with a wss:// endpoint.
  • The provided patch suggests that adding the codex-utils-rustls-provider dependency and calling ensure_rustls_crypto_provider() before connecting can resolve the issue.
  • To verify the fix, run the patched codex-cli with the --remote option and a wss:// endpoint, and check if the connection is successful.
  • The patch should be applied to the codex-app-server-client crate, specifically in the remote.rs file.

Example

The minimal patch provided in the issue body can be used as a starting point:

diff --git a/codex-rs/app-server-client/Cargo.toml b/codex-rs/app-server-client/Cargo.toml
@@
 codex-feedback = { workspace = true }
 codex-protocol = { workspace = true }
+codex-utils-rustls-provider = { workspace = true }

diff --git a/codex-rs/app-server-client/src/remote.rs b/codex-rs/app-server-client/src/remote.rs
@@
 use codex_app_server_protocol::ServerNotification;
 use codex_app_server_protocol::ServerRequest;
+use codex_utils_rustls_provider::ensure_rustls_crypto_provider;
@@
         if let Some(auth_token) = args.auth_token.as_deref() {
             ...
         }
+        ensure_rustls_crypto_provider();
         let stream = timeout(CONNECT_TIMEOUT, connect_async(request))

Notes

The provided patch is a local fix and may need to be adapted for the production environment. Additionally, the issue seems to be specific to the codex-cli version 0.118.0 and may not be present in other versions.

Recommendation

Apply the workaround by adding the codex-utils-rustls-provider dependency and calling ensure_rustls_crypto_provider() before connecting to the remote app-server over a secure websocket. This should resolve the issue and allow for successful connections.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING