[BUG] NODE_EXTRA_CA_CERTS is not effective when set in ~/.claude/settings.json
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?
This bug has been reported already in https://github.com/anthropics/claude-code/issues/10458
The issue still persists in the same way, since the issue was closed, I decided to create a duplicate.
When the NODE_EXTRA_CA_CERTS or SSL_CERT_FILE environment variables are set in ~./.claude/settings.json, they are not respected when requests are sent. Even though /status reports that additional CAs are set.
If they are set as environment variables (in any shell) before launching claude, they are respected.
What Should Happen?
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "<AUTH_TOKEN>",
"ANTHROPIC_BASE_URL": "<BASE_URL>",
"NODE_EXTRA_CA_CERTS": "<PATH_TO_CA>",
"SSL_CERT_FILE": "<PATH_TO_CA>"
}
}
With the following configuration claude should be able to send requests to the BASE_URL, instead I get Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates.
If NODE_EXTRA_CA_CERTS is set before launching in shell, it works.
Error Messages/Logs
Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates
Steps to Reproduce
- Use a
settings.jsonfile with aANTHROPIC_BASE_URLthat has a self-signed certificate - Set
NODE_EXTRA_CA_CERTSenvironment variable insettings.jsonto the correct certificate - Requests will fail with
Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.29
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
I reproduced this issue with on both Windows and macOS, with fish shell and powershell.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗