Skip to navigation

Claude Code Corporate Proxies: TLS Inspection, mTLS and Firewall Allowlists

In short: Enterprise proxies can break Claude Code through custom CAs, mTLS and host allowlists. Configure the network before changing model settings.

Published 17 min read
On this page

Direct answer

Fix the enterprise network path before changing Claude Code model or reasoning settings. Official: Claude Code documents HTTPS_PROXY, HTTP_PROXY, NO_PROXY, NODE_EXTRA_CA_CERTS, CLAUDE_CODE_CLIENT_CERT and CLAUDE_CODE_CLIENT_KEY. Those variables load once at startup. SOCKS proxies are unsupported, and essential hosts include api.anthropic.com, claude.ai and platform.claude.com.

Use the company proxy, trust the inspection CA through NODE_EXTRA_CA_CERTS, and add a client certificate only when the security team requires mutual TLS. Then restart the process and verify the exact route from a managed workstation. Never disable certificate verification to make a red error disappear. A correct configuration preserves encryption and identity checks while allowing the approved proxy to inspect traffic.

Why a TLS error belongs to the network team first

A failed request can look like a model problem because the visible symptom arrives inside a coding session. The wording may mention a connection, certificate or remote service. None of that identifies the model as the cause. If the client cannot establish an approved secure channel, changing models, effort or context size only moves the same failure to a different request.

The cost shows up in several places. A developer retries the same turn while the help desk checks an unrelated account setting. An engineer copies a certificate into the wrong trust location. A rollout script starts successfully on a home network but fails on the managed image because proxy variables are missing. Each detour consumes time without producing evidence about the service itself.

Separate three questions:

  1. Can this workstation reach the required host?
  2. Can it complete the expected certificate checks through the corporate proxy?
  3. Can the Claude Code process use the approved identity and settings?

The Claude Code custom API base URL guide is useful when an approved integration needs a different endpoint. It is not a reason to weaken transport security. The OpenAI versus Anthropic API format guide explains a separate compatibility boundary. Neither format choice repairs a broken certificate chain.

Corporate proxy evidence map separating proxy routing, custom CA trust, mutual TLS and allowed hosts
Evidence map based on Anthropic’s network configuration documentation, checked 2026-11-27. The documented controls do not prove that every enterprise proxy uses the same inspection design.

Proxy variables: configure the route, not the model

Official: the network reference names both HTTP and HTTPS proxy variables, a NO_PROXY bypass list, an extra CA certificate variable, and separate client certificate and client key variables. It also says those variables load once at startup. A shell export after Claude Code is already running is therefore not a reliable test of the new configuration.

Treat the proxy address as sensitive operational data. It may contain a username, password or token. Do not paste a full environment dump into a ticket, transcript or repository. Record the variable names, whether each is set, and a redacted host or route identifier approved for support use.

Network control Documented variable What it changes Verification
Secure web proxy HTTPS_PROXY Route for HTTPS requests Confirm approved proxy hostname and port without printing credentials
Web proxy HTTP_PROXY Route for HTTP requests Check whether the managed environment requires it
Direct exceptions NO_PROXY Hosts that bypass the proxy Include only approved local and internal destinations
Inspection trust NODE_EXTRA_CA_CERTS Additional certificate authority trust Verify the supplied CA file and restart the process
Client identity CLAUDE_CODE_CLIENT_CERT Certificate presented for mutual TLS Confirm the certificate belongs to the managed device or user
Client private key CLAUDE_CODE_CLIENT_KEY Private key paired with the client certificate Restrict file access and never copy the value into logs

A placeholder configuration can make the shape clear without exposing a real proxy:

HTTPS_PROXY=<approved proxy URL>
HTTP_PROXY=<approved proxy URL when required>
NO_PROXY=<approved direct exceptions>
NODE_EXTRA_CA_CERTS=<path to the company-supplied CA bundle>
CLAUDE_CODE_CLIENT_CERT=<path issued for mutual TLS>
CLAUDE_CODE_CLIENT_KEY=<restricted path to the paired private key>

Do not treat that block as a universal enterprise template. The network team decides which variables apply, where the files live and which hosts belong in NO_PROXY. A direct exception can bypass inspection, so convenience is not a sufficient reason to add one.

Restart after a change. Keep the old and new values in the change record, but redact embedded credentials. Then run one narrow check through the same user account, shell, device and network zone that will run Claude Code. A successful test from an administrator’s unrelated shell does not validate the developer’s launcher.

Custom CA: trust the inspection chain without abandoning verification

TLS inspection means a corporate proxy terminates and re-establishes encrypted connections so security tooling can examine traffic. The client may therefore see a certificate issued by a company certificate authority rather than the public authority it expected. This can be legitimate. The response is to configure the approved trust chain, not to accept every certificate.

A certificate authority, or CA, is an issuer that signs certificates. NODE_EXTRA_CA_CERTS adds the company’s CA to the client’s trust sources. Before using it, confirm that the file came through the managed software or security channel. A random bundle downloaded into a repository can expand trust to an attacker-controlled issuer.

Unknown: the fact pack does not describe every proxy product, certificate topology or managed-device policy. Some organizations use a forward proxy, some use a transparent gateway, and some add client authentication at another layer. The runbook must follow the actual architecture.

Proxy configuration workflow from startup variables through custom CA trust and a restarted narrow connection check
Workflow derived from Anthropic’s documented startup variables. The company CA and proxy behavior remain environment-specific, so the diagram is not a vendor-certified topology.

When a certificate check fails, preserve the error class and the destination host. Remove proxy passwords, authorization headers and client key material before sharing it. Then compare the chain presented on the failing route with the CA bundle configured for that process. The useful question is whether the approved issuer is missing, the file is unreadable, or the process started before the variable was set.

Failure mode Evidence to collect Safe response
Issuer not trusted Failing host, error class, process start time Validate and install the company CA through the managed channel
CA file not readable File path, owner and process identity Correct permissions with the platform team
Old process environment Variable change time and process start time Restart under the updated environment
Wrong bypass rule Destination matched by NO_PROXY Review the exception instead of disabling inspection
Proxy requires client identity Proxy response and certificate configuration state Use the issued certificate and key pair
Expired or mismatched client certificate Certificate metadata without private data Renew through the approved identity process

A common bad shortcut is turning off verification until the session works. Disabling verification removes the signal that distinguishes the approved proxy from an impersonator. The Claude Code settings-file secret exposure guide explains why configuration files deserve the same care as credentials. A CA path is not usually a secret, but an embedded proxy password or private key path can still reveal operational details.

Mutual TLS: prove the client identity

Mutual TLS, often written mTLS, adds client identity to the normal server identity check. The server presents its certificate, and the client presents its own. Claude Code exposes CLAUDE_CODE_CLIENT_CERT and CLAUDE_CODE_CLIENT_KEY for that purpose.

The two values must form a valid pair. A certificate for the wrong device, a key with broad readable permissions, or a path that exists only in an interactive shell can each break the connection. Keep the private key in the location approved by the security team. Do not place it in the project directory, where a repository operation or support export could capture it.

Official: the settings and hooks references describe configuration and tool controls, while the security documentation describes permission and sandbox boundaries. Those controls do not replace enterprise identity. A perfectly scoped Claude Code permission rule cannot make an expired client certificate valid.

mTLS check Pass condition Loss if skipped
Pair match Certificate and private key belong together Handshake fails before a useful model request
Device scope Issued identity matches the managed workstation Another device may be unable to connect
File access Only the intended process identity can read the key Secret handling becomes harder to defend
Renewal ownership A named team owns expiry and replacement Rollout can fail after a routine renewal
Startup load Variables exist before process launch A running process may keep stale settings

Test mTLS without using production project data. A narrow connection check from the managed device is enough to establish whether the network and identity path works. It does not prove that every Claude Code feature will work, and it does not justify attaching a production credential to a diagnostic script.

The Claude Code macOS Keychain permissions guide covers local credential storage. Keychain access and mTLS are related security concerns, but they are not the same mechanism. Fixing one does not automatically repair the other.

Allowlists: permit the required destinations deliberately

Official: the essential hosts listed in the network documentation include api.anthropic.com, claude.ai and platform.claude.com. That list is the starting point, not permission to invent additional domains or to allow an entire provider range. Follow the current official reference when a rollout depends on a complete destination list.

A host allowlist controls which destinations the network permits. It does not decide which files Claude Code may edit or which shell commands it may run. Keep network policy and tool permission policy separate, then test them together.

Layer Question Owner
DNS and routing Can the workstation resolve and reach the approved destination? Network team
Proxy policy Is the destination allowed through the inspection service? Security team
TLS trust Does the client trust the approved inspection chain? Endpoint security
mTLS identity Does the gateway accept this device or user certificate? Identity team
Claude Code permissions May the agent use the relevant tools in this project? Repository owner
Account access Is the signed-in account entitled to the requested surface? Account owner

The Claude Code MCP trust boundaries guide adds another network path: tool servers can introduce their own destinations and returned data. An allowlist that covers only the model hosts does not approve every MCP server. Review the exact server, its credential scope and its egress before connecting it.

The Claude Code dependency-install side effects guide covers executable package scripts. Those scripts may need package registries and may run code during installation. Do not solve a package-manager failure by broadening the entire workstation’s network access.

Enterprise network tradeoff map comparing inspection coverage, custom CA trust and mutual TLS client identity
Tradeoff map based on official network controls. More inspection can add operational dependencies, while weaker verification reduces protection. No universal security ranking is implied.

Worked verification example: isolate one variable at a time

Use a safe test matrix rather than a full development session. Derived: the numbers below use stated test assumptions and a simple rollout matrix, not a measured success rate or a vendor benchmark.

Assume a rollout group contains 12 managed workstations. The team tests three layers on each device: destination reachability, certificate trust, and a minimal Claude Code startup check. The plan produces 12 multiplied by 3 = 36 planned layer checks. If 30 pass and 6 fail, the observed pass share for that matrix is 30 / 36 = 83.3%. That says nothing about long-term reliability. It only tells the team where to investigate next.

Test layer Input held constant Change under test Evidence produced
Reachability Device, account, host Approved route only DNS, routing and proxy decision
Certificate trust Same route and host Company CA loaded before startup Issuer validation result
Client startup Same environment and project scope Restart with final variables Narrow process result
Feature smoke test Same approved identity One read-only task Tool and permission result

Do not start with a production migration or a large repository task. A read-only check limits the blast radius and makes a network failure easier to distinguish from a file-permission problem. If it passes, add one approved feature at a time. A successful model response does not prove that hooks, subagents or external tools share the same network behavior.

Keep a redacted configuration generation number with each result. When a managed image updates, that identifier shows whether the failing device received the intended CA and proxy settings. It also prevents a support ticket from mixing evidence collected before and after a restart. If two devices share the same generation but fail differently, compare their network zone, launcher and user identity before changing the shared configuration.

A failed smoke test can still be useful. Record the layer, the first failing step and the configuration generation that ran. Avoid changing model, proxy and certificate settings together. The approach destroys the comparison and makes the final working state hard to reproduce.

The Claude Code network storm and NAT retry diagnosis guide explains why connection counts matter during faults. A proxy outage can produce repeated reconnects, so one workstation should not run an unbounded diagnostic loop while the team investigates.

A rollout checklist that another team can audit

Begin with an owner for each layer. The network owner approves destinations. The endpoint owner distributes the CA. The identity owner issues client certificates. The repository owner defines the Claude Code permission boundary. One person may hold several roles, but every check needs a named owner.

Rollout stage Required evidence Stop condition
Inventory OS, architecture, launcher and network zone Unsupported or unidentified platform
Route review Approved proxy and destination list Undocumented broad exception
Trust setup Company CA source and file permissions Unverified certificate bundle
Identity setup mTLS pair and renewal owner when required Missing or mismatched client identity
Startup check Variables present before launch Stale process environment
Narrow smoke test Redacted result from the managed device Repeated failures or unbounded retries
Permission check Project scope and allowed tools Agent can exceed the intended task
Rollback Previous approved configuration No way to restore a known state

Official: setup documentation lists macOS 13+, Windows 10 1809+ and supported Linux distributions, with x64 or ARM64 processors and at least 4 GB RAM. Windows native lacks sandboxing. Those requirements matter during enterprise rollout because a network test on an unsupported image does not validate the supported fleet.

On Windows, the exact shell and path handling can change the result. The Claude Code PowerShell path quoting guide focuses on a reported silent status-line failure, not every Windows hook. Use it as a reminder to test the actual launcher and exit code. On ARM or headless systems, the Claude Code Linux ARM and headless login guide separates platform verification from model troubleshooting.

Enterprise rollout control checklist from device inventory through CA, mTLS, smoke test and rollback
Control checklist derived from official setup, network, permission and hook documentation. The checklist is an operational recommendation, not an Anthropic certification program.

Keep the rest of the operating plan connected

A working proxy solves one failure class. It does not make a session portable, a migration safe or a generated change correct. Use the cluster to build the surrounding controls.

That connected plan matters because enterprise controls fail at the seams. A valid CA does not scope an agent. A narrow permission rule does not authorize a database migration. A working phone session does not replace workstation review.

Concrete win, honest loss and practical implication

The win is diagnostic precision. A team can show that the destination resolves, the proxy accepts it, the approved CA validates the chain and the issued client identity completes mTLS. That evidence turns a vague connection problem into a bounded configuration change.

The loss is operational overhead. Inspection and mutual TLS add certificate distribution, renewal, startup ordering and exception review. They can also create a single managed dependency that must be tested across launchers and network zones. A configuration that works on one device does not establish fleet-wide reliability.

The practical implication is simple: make network readiness a release gate, then keep a narrow rollback path. Do not let a developer bypass inspection to finish one task. Do not let a rollout owner declare success from a single shell probe. Require evidence from the same process path that will run the agent.

Data gaps and future updates

Unknown: the supplied sources do not provide a universal proxy product matrix, a complete enterprise destination inventory for every integration, or a measured failure rate for custom CA and mTLS setups. They also do not establish one correct NO_PROXY policy for every company.

Update this runbook when the official network reference changes, when the company changes its inspection service, or when a new integration adds destinations. Record the checked date with the configuration. Preserve contradictory observations instead of forcing them into one success story.

Corporate proxy verdict showing approved routing, trusted CA and mutual TLS ahead of model-setting changes
Verdict from official network and setup documentation, checked 2026-11-27. Correct transport configuration is necessary, but it does not guarantee feature compatibility or service availability.

A practical OpenAI-format test route with One AI API Key

If the immediate goal is to test an agent route without another subscription, the 46 live free model IDs run through OpenAI-format agents. The endpoint quickstart shows the base URL and first request. Use an agent that supports the OpenAI format rather than pasting a free ID into Claude Code.

The documented Claude Code route is not a current fallback. First-party, checked 2026-11-27: all four Claude IDs were unavailable, and free IDs are OpenAI-format only. The free lane shares 100 requests and 5,000,000 tokens per day per account, resets at 05:30 IST / 00:00 UTC, and allows one request in flight per key. Accounts can have up to three keys.

New accounts receive $10 credit with no card, and billing is prepaid with no subscription or seat fee. The prepaid pricing page is the place to verify current terms. The published privacy and retention policy says prompts are not used for training by default and describes per-key controls. Upstream providers still receive requests under their own terms.

The service documents same-model retries and configurable fallback headers, while another overview says it does not answer with a different model. Treat that as a contradiction, not a guarantee of automatic failover. Use the per-key cap and model allowlist reference for access control, and create an account only if this separate test route fits the task. It is not a way to make unavailable Claude IDs work inside Claude Code.

FAQ

Can Claude Code use a SOCKS proxy?

Official: the supplied network documentation says SOCKS proxies are unsupported. Use the documented proxy variables and an approved HTTP or HTTPS proxy path. Do not disguise a SOCKS setup as a supported configuration.

Why did changing the proxy variable not fix the running session?

The documented variables load once at startup. Confirm that the variable existed before the process launched, then restart through the same managed launcher. A change in another terminal may not affect the running process.

Is NODE_EXTRA_CA_CERTS safe to use with TLS inspection?

It is the documented way to add a custom CA. Safety depends on obtaining the correct bundle through an approved channel, restricting who can replace it and keeping certificate verification enabled.

Do mTLS variables replace Claude Code permissions?

No. mTLS authenticates the client to the network gateway. Claude Code permissions control tool use. Both boundaries need review.

Should a rollout allow every Anthropic domain?

No. Start from the current official network reference, map each required host to a purpose and approve only the destinations the workflow needs. MCP servers and package installs may require a separate review.

Sources

More in Blog

Try it

One API key for GPT, Grok, DeepSeek, Kimi, GLM, MiniMax, Qwen, Step, Beam, Nemotron, ERNIE, Hunyuan, Gemma, Laguna, LFM, LongCat, Llama, Solar, Jais, Mistral, K2 and Roleplay.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.

New accounts$10 credit on sign-up
  • 100requests
    per day
  • 3Mtokens
    per day
  • 47free
    models
  • $0per
    token
  • No card
  • No end date
Claim $10 credit →