`no_proxy()` in OAuth discovery breaks MCP login behind HTTPS proxies
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- authentication, networking
Research direction
Start in codex-rs/rmcp-client/src/auth_status.rs at the reqwest client used for OAuth discovery, then compare it with the client in perform_oauth_login.rs. Reproduce with HTTPS_PROXY configured and direct outbound access blocked. Done means the .well-known/oauth-authorization-server request respects the configured proxy and codex mcp login <server-name> completes discovery.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
0.130.0
What subscription do you have?
Enterprise
Which model were you using?
No response
What platform is your computer?
macOS
What terminal emulator and version are you using (if applicable)?
No response
Codex doctor report
What issue are you seeing?
The .no_proxy() to the reqwest client used for OAuth discovery in codex-rs/rmcp-client/src/auth_status.rs:89 breaks MCP OAuth login in environments where all outbound traffic must route through a corporate HTTPS proxy. Many enterprise setups use mandatory forward proxies for security policy enforcement, credential injection, or network isolation. In these environments, direct connections are blocked at the network level — processes can only reach external hosts via the configured HTTPS_PROXY.
With .no_proxy(), the OAuth discovery request bypasses the proxy and fails because the direct connection is refused.
What steps can reproduce the bug?
- Configure an environment where HTTPS_PROXY points to a mandatory forward proxy and direct outbound connections are blocked (e.g., corporate firewall, sandbox, VPN split-tunnel)
- Configure a streamable HTTP MCP server (e.g., in config.toml)
- Run codex mcp login
- OAuth discovery times out or fails with a connection error because the .no_proxy() client cannot reach the .well-known/oauth-authorization-server endpoint directly
What is the expected behavior?
The OAuth discovery client should respect HTTPS_PROXY / HTTP_PROXY environment variables, like every other HTTP client in the codebase. The discovery request should route through the configured proxy so it works in environments where proxy use is mandatory.
Additional information
The actual login flow in perform_oauth_login.rs correctly uses ClientBuilder::new() without .no_proxy() — so the transport client respects the proxy. Only the discovery path is broken.
If the system-configuration crash is a concern, then build the client without it, explicitly use ENV vars only. Example:
let mut builder = Client::builder().timeout(DISCOVERY_TIMEOUT).no_proxy();
if let Ok(url) = std::env::var("HTTPS_PROXY")
.or_else(|_| std::env::var("https_proxy"))
.or_else(|_| std::env::var("HTTP_PROXY"))
.or_else(|_| std::env::var("http_proxy"))
{
if let Ok(proxy) = reqwest::Proxy::all(&url) {
builder = builder.proxy(proxy);
}
}
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·