curl works but claude won't connect — the 5 distinct TLS/DNS causes behind Claude Code CLI failures in corporate/VPN environments
In locked-down environments, claude /login (or claude update) fails with CERT_HAS_EXPIRED, getaddrinfo EREFUSED, a 503, or EPERM — while curl to the same host returns a clean 200. The generic error collapses five distinct causes into one line and usually points you at "your proxy," which is wrong most of the time. Here's how to tell which one you actually have.
These mechanisms are relayed from incidents reported on the tracker in late June 2026 (numbers at the end); I helped triage each. I'm stating the mechanism, not claiming I reproduced every environment.
The native CLI runs on Bun, which validates TLS against its own bundled CA/trust store (BoringSSL) and, on some paths, resolves DNS through its own path rather than the OS getaddrinfo. So a clean curl -vI only proves the OS path is health