Repository navigation
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 #17860
Description
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 binary | Linux binary | |
|---|---|---|
| TLS library | native-tls (SecureTransport) | rustls 0.23.36 |
| JA3 fingerprint | Browser-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 fineLogs
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
- Short-term: Allowlist the Codex CLI's User-Agent / request pattern in Cloudflare WAF rules for
chatgpt.com - Long-term: Use
native-tls(OpenSSL) on Linux instead ofrustls, or implement JA3 fingerprint randomization viarama-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
- codex login fails: Cloudflare challenge blocks CLI token exchange (Australia/Linux) #16052 — Cloudflare challenge blocks CLI token exchange (Linux)
- Codex desktop plugin marketplace unreachable — Cloudflare challenge blocks plugins/featured API, preventing new plugin installs #16808 — Plugin marketplace unreachable due to Cloudflare 403
- 0.118.0 gets stuck on startup when
plugins/featuredreturns a Cloudflare challenge page #16543 — Startup hangs whenplugins/featuredreturns Cloudflare challenge - Windows desktop app can hang on send and may relaunch after close; plugin/connectors discovery gets Cloudflare 403 HTML #16618 — Windows desktop app gets Cloudflare 403 on plugin/connectors discovery
- Official codex-cli login works, but another ChatGPT OAuth client using auth.openai.com succeeds at authorize/callback and then gets 403 unsupported_country_region_territory on /oauth/token #14215 — Third-party OAuth client 403 due to proxy (different root cause but same symptom)
Activity
github-actions commentedon Apr 15, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
plugins/featuredreturns a Cloudflare challenge page #16543Powered by Codex Action
kartojal commentedon Apr 20, 2026
getting same issue, both in WSL and in Mac, unable to use my ChatGPT subscription with Codex since last week
masakielastic commentedon May 17, 2026
I see a similar Linux-vs-macOS difference, but my diagnostics suggest that this may not be solely a rustls/TLS fingerprint issue.
Observed matrix:
Additional curl diagnostic from the Chromebook/Crostini environment:
cf-mitigated: challengecf-mitigated: challengeSo HTTP-layer signals such as User-Agent appear to influence Cloudflare’s decision in my environment. This may be related to #18456, where reqwest-based HTTP clients missing a proper User-Agent override are discussed.
fix(divybot): auto-disable codex discovery on hosts (Cloudflare TLS-f…
yangthen commentedon Jul 1, 2026
linux can not use
GlenDC commentedon Sep 9, 2026
Rama offers tls and http UA emulation already, but for that for now you need to rely on the
boringrama feature instead. Happy to help get this straight for you. In case OpenAI can fund it we also have some interesting roadmap items regarding being able to do this with Rustls as well. See https://ramaproxy.com/ for more info on that. Feel free to also join our discord of rama in case you need guidance on how you can make use of rama's built-in UA emulation capabilities. I also suggest you upgrade to latest release of rama while you are at it (see also #39557 ).