Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Claude Code error

Claude Code: Unable to connect to API: SSL certificate verification failed...

Error message
Unable to connect to API: SSL certificate verification failed (UNABLE_TO_GET_ISSUER_CERT_LOCALLY).

Status: WorkaroundLast verified 3 documented fixes3 sources

What it means

A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Claude Code does not trust it. The self-signed variant reads Unable to connect to API: Self-signed certificate detected (SELF_SIGNED_CERT_IN_CHAIN). During /login it reads SSL certificate error (UNABLE_TO_GET_ISSUER_CERT_LOCALLY).

Causes

  • A TLS-inspecting corporate proxy
  • A gateway signed by a private CA

How to fix it

  1. Fix 1.

    Export your organization's CA bundle and point Claude Code at it.

    Terminal
    NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem
  2. Fix 2.

    See Network configuration (custom CA certificates) for full setup, or add the CA to the system certificate store.

  3. Fix 3.

    Do not set NODE_TLS_REJECT_UNAUTHORIZED=0, which disables certificate validation entirely.

More Claude Code errors

All 18 Claude Code errors

FAQ

What does "Unable to connect to API: SSL certificate verification failed..." mean in Claude Code?

A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Claude Code does not trust it. The self-signed variant reads Unable to connect to API: Self-signed certificate detected (SELF_SIGNED_CERT_IN_CHAIN). During /login it reads SSL certificate error (UNABLE_TO_GET_ISSUER_CERT_LOCALLY).

How do I fix "Unable to connect to API: SSL certificate verification failed..."?

There are 3 documented fixes. Start with the first: Export your organization's CA bundle and point Claude Code at it.

Is this Claude Code error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it. Affected versions: All versions. Since v2.1.199 certificate failures are not retried; v2.1.273 added the OpenSSL code and NODE_EXTRA_CA_CERTS hint; v1.0.40 fixed this error appearing when NODE_EXTRA_CA_CERTS was set.

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.