anthropics / anthropics/claude-code

[BUG] SSL certificate verification failed when routing via custom inference gateway / corporate proxy

Đang mở
#94,438 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:networking bug has repro platform:windows regression
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

When running Claude Code in environments that route traffic through a custom corporate API gateway or SSL inspection proxy, requests fail due to SSL certificate verification errors.

Specifically, when Claude Code is invoked via Claude Desktop / Claude Code integration (`isClaudeCodeForDesktopEnabled = true`) or directly against a custom inference gateway (`inferenceGatewayBaseUrl`), network calls to the model endpoint fail with an SSL verification error.

Tested versions with NO SSL error:
- 1.32885.1 (commit a757f5)
- 1.37937.3 (commit 28dcf5)

Tested versions exhibiting the SSL error:
- 1.40609.1 (commit 69aac0)
- 1.46388.4 (commit 50e62f)

System / Environment:
- Platform: win32 (x64)
- OS Version: Windows 10.0.26100
- CPU: 13th Gen Intel(R) Core(TM) i7-1360P (16 cores)
- Memory: 16 GB total, 2 GB available

Observation:
The regression was introduced between 1.37937.3 and 1.40609.1. Earlier builds respect system/gateway certificates or existing TLS configurations, whereas 1.40609.1 and all subsequent releases consistently throw SSL verification failures in the exact same enterprise environment.

### What Should Happen?

Claude Code should complete API requests through configured custom inference proxies/gateways without failing SSL verification, or properly inherit trusted root CAs from standard environment configuration (NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, system trust store).

### Error Messages/Logs

```shell
API Error: Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates
```

### Steps to Reproduce

1. Configure Claude Code in an environment that routes model inference via an enterprise proxy or API gateway (inferenceGatewayBaseUrl = "https://aigateway.example.com").
2. Execute any prompt or command with Claude Code (`claude "hello"` or via the Claude Code integration).
3. Observe the immediate failure: API Error: Unable to connect to API: SSL certificate verification failed.
4. Downgrade/switch back to version 1.37937.3 under identical network settings: requests succeed normally.
5. Upgrade to 1.40609.1 or 1.46388.4: SSL verification fails again.

### Claude Model

Sonnet (default)

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

1.37937.3

### Claude Code Version

Claude 1.52386.6 (612f3f) 2026-09-13T00:45:40.000Z

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Windows Terminal

### Additional Information

Workarounds tested:

- What worked (insecure bypass only):
Setting NODE_TLS_REJECT_UNAUTHORIZED=0 bypasses the failure, confirming the issue is strictly root CA / SSL certificate validation in the client runtime.
- What did NOT work:
NODE_OPTIONS, NODE_USE_SYSTEM_CA, NODE_EXTRA_CA_CERTS (after explicitly exporting and pointing to the full corporate root CA bundle), and SSL_CERT_FILE. The runtime appears to ignore or fail to pass these CA options to the underlying HTTP client initiating the inference requests.

Relevant Configuration Details:
```
[deployment-mode] Effective mode: 3P
[deployment-mode] Persisted mode choice: 3p
[deployment-mode] inferenceProvider set: yes
[deployment-mode] Bootstrap configured: no
[managed-config] Source: local
[managed-config] inferenceGatewayBaseUrl = "https://aigateway.example.com"
[managed-config] isClaudeCodeForDesktopEnabled = true
[managed-config] isLocalDevMcpEnabled = true
[managed-config] autoModeEnabled = true
[managed-config] toolSearchEnabled = true
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.