[BUG] TLS certificate verification fails on Windows unless connected to VPN
Preflight Checklist
- [x] I have searched existing issues 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 calling an external HTTPS API from Claude Code on Windows, the request fails with:
UNKNOWN_CERTIFICATE_VERIFICATION_ERROR
This only happens when not connected to VPN.
The same HTTPS endpoint works correctly from:
- PowerShell (
curl) - Windows browsers
- Node.js
- Python
- Any tool that uses the Windows certificate store
This strongly suggests that the native Claude Code Windows build (Bun-based) is using its own TLS implementation that does not fully trust or validate the Windows certificate store.
As a result, Claude Code cannot establish a TLS connection to certain valid HTTPS endpoints unless a VPN is active (which rewrites the certificate chain).
What Should Happen?
Claude Code should successfully establish HTTPS connections on Windows using the same certificate trust chain that Windows itself uses, without requiring a VPN.
If Windows trusts the certificate (as verified via PowerShell curl), Claude Code should trust it as well.
Error Messages/Logs
UNKNOWN_CERTIFICATE_VERIFICATION_ERROR
Steps to Reproduce
- Install Claude Code on Windows using the official installer:
irm https://claude.ai/install.ps1 | iex
- Open a new PowerShell terminal.
- Run any Claude Code command that triggers an HTTPS request to:
https://api.z.ai/api/anthropic
Example:
claude "call https://api.z.ai/api/anthropic"
- Observe the error:
UNKNOWN_CERTIFICATE_VERIFICATION_ERROR
- Verify that the same endpoint works correctly outside Claude Code:
curl https://api.z.ai/api/anthropic
(returns HTTP 200 without TLS errors)
- Connect to a corporate VPN (e.g., Zscaler).
- Run the same Claude Code command again.
- Observe that the request now succeeds when VPN is active.
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.89
Claude Code Version
2.1.92 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗