codex - 💡(How to fix) Fix Linux/WSL2: Cloudflare 403 blocks all chatgpt.com API requests — rustls TLS fingerprint detected as bot while macOS native-tls works fine on same network [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#17860Fetched 2026-04-15 06:27:11
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1unlabeled ×1

Codex CLI on Linux (WSL2) is completely unusable with ChatGPT login — every request to chatgpt.com/backend-api/ returns HTTP 403 with a Cloudflare JavaScript challenge page. The same account, same proxy node, same network works perfectly on macOS.

Error Message

WARN codex_core::plugins::manager: failed to warm featured plugin ids cache
  error=remote plugin sync request to https://chatgpt.com/backend-api/plugins/featured
  failed with status 403 Forbidden: <html>...<span id="challenge-error-text">
  Enable JavaScript and cookies to continue</span>...

WARN codex_tui::chatwidget: failed to load full apps list;
  falling back to installed apps snapshot: Failed to load apps:
  Request failed with status 403 Forbidden

Root Cause

After binary analysis, the difference is the TLS implementation:

macOS binaryLinux binary
TLS librarynative-tls (SecureTransport)rustls 0.23.36
JA3 fingerprintBrowser-like (Safari-similar)Automated client signature
Cloudflare result✅ Pass❌ 403 challenge

The Linux binary (x86_64-unknown-linux-musl) is statically compiled with rustls + rama-tls-rustls, producing a TLS Client Hello that Cloudflare's bot detection flags as non-browser traffic. The macOS binary uses the system TLS stack (SecureTransport), whose fingerprint resembles Safari and passes Cloudflare without challenge.

Evidence from binary strings:

# 97 references to rustls vs 3 to native-tls in Linux binary
tokio-rustls-0.26.4
rama-tls-rustls-0.3.0-alpha.4
rustls-0.23.36
utils/rustls-provider/src/lib.rs

Fix Action

Workaround

Using OPENAI_API_KEY instead of ChatGPT login bypasses chatgpt.com entirely (routes through api.openai.com which is not affected).

Code Example

# 97 references to rustls vs 3 to native-tls in Linux binary
tokio-rustls-0.26.4
rama-tls-rustls-0.3.0-alpha.4
rustls-0.23.36
utils/rustls-provider/src/lib.rs

---

# On Linux/WSL2:
curl -I --proxy http://127.0.0.1:7890 https://chatgpt.com/backend-api/plugins/featured
# → HTTP 403, cf-mitigated: challenge

# On macOS (same proxy, same node):
# → Works fine

---

WARN codex_core::plugins::manager: failed to warm featured plugin ids cache
  error=remote plugin sync request to https://chatgpt.com/backend-api/plugins/featured
  failed with status 403 Forbidden: <html>...<span id="challenge-error-text">
  Enable JavaScript and cookies to continue</span>...

WARN codex_tui::chatwidget: failed to load full apps list;
  falling back to installed apps snapshot: Failed to load apps:
  Request failed with status 403 Forbidden
RAW_BUFFERClick to expand / collapse

Description

Codex CLI on Linux (WSL2) is completely unusable with ChatGPT login — every request to chatgpt.com/backend-api/ returns HTTP 403 with a Cloudflare JavaScript challenge page. The same account, same proxy node, same network works perfectly on macOS.

Root Cause Analysis

After binary analysis, the difference is the TLS implementation:

macOS binaryLinux binary
TLS librarynative-tls (SecureTransport)rustls 0.23.36
JA3 fingerprintBrowser-like (Safari-similar)Automated client signature
Cloudflare result✅ Pass❌ 403 challenge

The Linux binary (x86_64-unknown-linux-musl) is statically compiled with rustls + rama-tls-rustls, producing a TLS Client Hello that Cloudflare's bot detection flags as non-browser traffic. The macOS binary uses the system TLS stack (SecureTransport), whose fingerprint resembles Safari and passes Cloudflare without challenge.

Evidence from binary strings:

# 97 references to rustls vs 3 to native-tls in Linux binary
tokio-rustls-0.26.4
rama-tls-rustls-0.3.0-alpha.4
rustls-0.23.36
utils/rustls-provider/src/lib.rs

Impact

This affects all chatgpt.com endpoints on Linux, not just login:

  • chatgpt.com/backend-api/codex/responses — can't send/receive messages
  • chatgpt.com/backend-api/plugins/featured — startup hangs loading plugins
  • ❌ Plugin marketplace — can't refresh plugin list
  • ❌ OAuth token refresh — sessions can't renew

Codex launches, MCP servers start, but the agent never responds to any input.

Environment

  • Codex version: 0.120.0
  • OS: Ubuntu 24.04 on WSL2 (Windows 11, kernel 6.6.87.2)
  • Install: npm global (@openai/codex)
  • Proxy: Clash Verge mixed mode on port 7890 (same proxy used on macOS where it works)
  • Exit IP: Zenlayer US (Los Angeles) — same node on both platforms

Reproduction

# On Linux/WSL2:
curl -I --proxy http://127.0.0.1:7890 https://chatgpt.com/backend-api/plugins/featured
# → HTTP 403, cf-mitigated: challenge

# On macOS (same proxy, same node):
# → Works fine

Logs

WARN codex_core::plugins::manager: failed to warm featured plugin ids cache
  error=remote plugin sync request to https://chatgpt.com/backend-api/plugins/featured
  failed with status 403 Forbidden: <html>...<span id="challenge-error-text">
  Enable JavaScript and cookies to continue</span>...

WARN codex_tui::chatwidget: failed to load full apps list;
  falling back to installed apps snapshot: Failed to load apps:
  Request failed with status 403 Forbidden

Suggested Fix

  1. Short-term: Allowlist the Codex CLI's User-Agent / request pattern in Cloudflare WAF rules for chatgpt.com
  2. Long-term: Use native-tls (OpenSSL) on Linux instead of rustls, or implement JA3 fingerprint randomization via rama-tls-rustls (which is already bundled but apparently not configured for fingerprint emulation)

Workaround

Using OPENAI_API_KEY instead of ChatGPT login bypasses chatgpt.com entirely (routes through api.openai.com which is not affected).

Related Issues

  • #16052 — Cloudflare challenge blocks CLI token exchange (Linux)
  • #16808 — Plugin marketplace unreachable due to Cloudflare 403
  • #16543 — Startup hangs when plugins/featured returns Cloudflare challenge
  • #16618 — Windows desktop app gets Cloudflare 403 on plugin/connectors discovery
  • #14215 — Third-party OAuth client 403 due to proxy (different root cause but same symptom)

extent analysis

TL;DR

The most likely fix is to modify the Codex CLI's TLS implementation to mimic a browser-like signature, either by using native-tls on Linux or implementing JA3 fingerprint randomization via rama-tls-rustls.

Guidance

  • Investigate using native-tls (OpenSSL) on Linux instead of rustls to achieve a browser-like TLS fingerprint.
  • Consider implementing JA3 fingerprint randomization via rama-tls-rustls to make the Codex CLI's requests appear more like those from a browser.
  • As a temporary workaround, use the OPENAI_API_KEY instead of ChatGPT login to bypass the affected chatgpt.com endpoints.
  • Review Cloudflare WAF rules for chatgpt.com to determine if allowlisting the Codex CLI's User-Agent or request pattern is a viable short-term solution.

Example

No code snippet is provided as the issue is related to the TLS implementation and binary compilation.

Notes

The suggested fixes and workarounds are based on the analysis of the TLS implementation difference between the macOS and Linux binaries. However, the effectiveness of these solutions may depend on the specific Cloudflare WAF rules and the Codex CLI's implementation details.

Recommendation

Apply the workaround by using the OPENAI_API_KEY instead of ChatGPT login, as it bypasses the affected chatgpt.com endpoints and allows for continued use of the Codex CLI on Linux. This workaround is recommended due to its simplicity and effectiveness in avoiding the Cloudflare challenge issue.

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