[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?
Hi, My setting.json (~/.claude/settings.json) is as below:
{
"permissions": {
"deny": [
]
},
"env": {
"HTTPS_PROXY": "http://127.0.0.1:8081",
"NODE_EXTRA_CA_CERTS": "/Users/username/.mitmproxy/mitmproxy-ca-cert.pem",
"SSL_CERT_FILE": "/Users/username/./mitmproxy-ca-cert.pem"
}
}
mitm proxy is running at "http://127.0.0.1:8081", when I start claude, I don't see traffic received to claude via mitmroxy and see error - Unable to connect to API due to poor internet connection, please see the attached screen shot.
https://docs.claude.com/en/docs/claude-code/network-config this document says that NODE_EXTRA_CA_CERTS can be a env inside the settings.json, but it doesn't seem to work
<img width="399" height="111" alt="Image" src="https://github.com/user-attachments/assets/8e6b47eb-7035-4be4-8f2f-bb3c24d3b1d5" />
What Should Happen?
If I set the env explicitly in the shell like:
export NODE_EXTRA_CA_CERTS = "/Users/username/.mitmproxy/mitmproxy-ca-cert.pem" , claude code works without any issue. Can we please fix that this env is taken from the env section of claude code like other env variables.
Error Messages/Logs
Unable to connect to API due to poor internet connection
Steps to Reproduce
Have the settings.json as below:
{
"permissions": {
"deny": [
]
},
"env": {
"HTTPS_PROXY": "http://127.0.0.1:8081",
"NODE_EXTRA_CA_CERTS": "/Users/username/.mitmproxy/mitmproxy-ca-cert.pem",
"SSL_CERT_FILE": "/Users/username/./mitmproxy-ca-cert.pem"
}
}
and start mitmproxy running as mitmproxy -p 8081
and then launch claude code via terminal.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.27 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗