[BUG] SSL certificate has expired not working since 2.1.190+ on mac
Status Fixed / completed
Reported on v2.1.170
Maintainer reply None cached
Activity 12 comments · opened Jun 26, 2026 · closed Aug 17, 2026
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?
I'm getting this error in the cli:
Unable to connect to API: SSL certificate has expired
I already set NODE_EXTRA_CA_CERTS with the correct pem and validated it.
If I install 2.1.170 it works well but then in 2.1.190+ it fails with that message, regardless of the NODE_EXTRA_CA_CERTS
Claude desktop works well
Tried with
cat ~/.claude/settings.json
{
"theme": "dark",
"env": {
"NODE_EXTRA_CA_CERTS": "cert.pem"
}
Using a CASB
Using /doctor or /bug didn't not work neither
What Should Happen?
It should allow me to use the cli
Error Messages/Logs
✻ Unable to connect to API: SSL certificate has expired · Retrying in 2s · attempt 3/10
Steps to Reproduce
Open Claude cli and talk
Claude Model
_No response_
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.170
Claude Code Version
2.1.190
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
11 Comments
(Another user.) A few concrete things to try, in order — the first one is the most likely culprit given your settings.
1.
NODE_EXTRA_CA_CERTSmust be an absolute path. Your settings has"NODE_EXTRA_CA_CERTS": "cert.pem"— a relative path. Node resolvesNODE_EXTRA_CA_CERTSrelative to the process working directory, not~/.claude, so unless you happen to launch from the dir that containscert.pem, Node silently loads nothing and you're back to the default CA store (which won't trust your CASB's intercept cert). Use the full path:2. Also export it in the shell, not only in settings.json. The
envblock in settings.json is applied by Claude Code after startup; the very first TLS connection can happen before that. Setting it in the actual environment removes that timing question:If it works from the shell but not from settings.json, that's the timing/ordering bug to report.
3. Confirm the cert in the chain isn't actually expired. The message "SSL certificate has expired" (vs. "self-signed" / "unable to get local issuer") means a cert in the presented chain is past its
notAfter— adding a CA won't fix an expired one. Check what your CASB is presenting and your pem's dates:If the CASB's intercept/root cert has expired, the CASB admin has to renew it — that part is outside Claude Code.
The regression angle for Anthropic: works on 2.1.170, fails on 2.1.190+ with the same
NODE_EXTRA_CA_CERTS. That strongly suggests 2.1.190 changed cert handling — e.g. a bundled-Node bump with stricter chain validation, or the env var no longer being honored. Worth noting in the report that the var is set and validated, the only variable is the CLI version, and that Claude Desktop (different runtime) is unaffected — that narrows it to the CLI's TLS stack between those two builds.Hey yes I've put the relative path in the description to don't naming and
location details but I'm using absolute path
El vie, 26 de jun de 2026, 5:34 p.m., ゆる草 @.***>
escribió:
--
Confidentiality notice: This email and any attachments are confidential
and for the intended recipient only. Unauthorized review, use, disclosure,
copying or distribution is prohibited. If received in error, notify the
sender immediately and delete all copies.
It is also failing on IJ Idea and VS Code, probably because they use CLI internally
@medalliaerlich Check your keychain for any expired root certificates. Clearing them out fixed the issue for me.
I did this:
Validity
Not Before: Oct 30 14:32:20 2024 GMT
Not After : Oct 25 14:32:20 2044 GMT
only one and seems correct
winget install, 2.1.197, DST Root X3 removal didn't help, downgrade to 2.1.177 did.
Thanks, that seems to work for most people experiencing this issue.
That being said: having _any_ expired root certificates in the keychain should not be a blocker for using a specific admin-trusted SSL certificate that's not expired. Anthropic engineers should still look into this issue.
claude install 2.1.177@medalliaerlich You're right, and thanks for the correction — since you were already using an absolute path, my earlier guess about
NODE_EXTRA_CA_CERTSwas wrong. Retracting it so it doesn't send anyone else down that path.For anyone landing on this thread later: the fix that actually worked for multiple people here is removing the expired root certificate from the system keychain, as @JLau-cy described above. That matches the reported symptoms much better than my path theory did.
Don"t remove base Windows certificates, MS ships them intentionally.
Please, just review the changes between 177 and 190 related to ssl certs, some change between those versions broke it