---
title: "“Unable to connect to API: SSL certificate verification failed” on Mac · Kilobat Guides"
url: "https://kilobat.app/guides/claude-code-ssl-certificate-verification-failed"
description: "Claude Code on your Mac reports SSL certificate verification failed. A proxy or private CA signs the traffic. Add its CA with NODE_EXTRA_CA_CERTS."
---

# “Unable to connect to API: SSL certificate verification failed” on Mac

Claude Code prints this when a certificate comes from an authority that it does not trust. The documentation names a TLS-inspecting corporate proxy or a gateway with a private CA.

**Fix this with your agent**Copies a prompt for Claude Code, Codex or any agent that can use Terminal.

My Mac has this problem: “Unable to connect to API: SSL certificate verification failed” on Mac. Read https://kilobat.app/guides/claude-code-ssl-certificate-verification-failed.md and work through it with me. Install the Kilobat CLI if it’s missing: brew install seifip/kilobat/kilobat. Run the guide’s Terminal and kilobat checks yourself and tell me what you find. List the steps only I can do. Ask before you change any setting.

Applies to: Claude Code in a terminal on all current macOS versions. · Checked: 29 October 2026

## Symptoms

- Claude Code prints `Unable to connect to API: SSL certificate verification failed`.
- The code reads UNABLE_TO_GET_ISSUER_CERT_LOCALLY, or the text says self-signed certificate.
- It starts on a work network.

## Likely causes

- **A TLS-inspecting proxy.** A proxy or security appliance intercepts TLS traffic with its own certificate.
- **A gateway with a private CA.** An LLM gateway can use a certificate from a private authority.
- **A CA file that fails to load.** Claude Code warns when it cannot read the NODE_EXTRA_CA_CERTS file.
- **A wrong clock.** A far-off date breaks certificate checks.

## How to check

1. Read the issuer.

   ```
   curl -v -o /dev/null https://api.anthropic.com 2>&1 | grep -i issuer
   ```
2. Show the variable.

   ```
   echo $NODE_EXTRA_CA_CERTS
   ```
3. Start Claude Code with debug logging, then read the CA lines in the log.

   ```
   claude --debug
   ```
4. Check the date.

   ```
   date
   ```

## How to fix it

1. Get the CA bundle from the administrator, in PEM format.
2. Point Claude Code at it before launch.

   ```
   export NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem
   ```
3. Or add the CA to the macOS system certificate store, as the documentation says.
4. Do not set `NODE_TLS_REJECT_UNAUTHORIZED=0`. It turns off validation.

## With Kilobat

1. Kilobat's connection doctor tests the API host layer by layer. The TLS layer shows who signed the certificate.

   ```
   kilobat why https://api.anthropic.com
   ```
2. These Kilobat checks are free. AI agents run them through MCP with `diagnose_connection` and `diagnose_network`. See [Find why one site or API won't connect](https://kilobat.app/guides/recipes/why-cant-it-connect).

## Questions

**Does Claude Code use the macOS certificate store?**

By default it trusts its bundled Mozilla CAs and the operating system store. Native installs always read the system store.

**Can I turn validation off?**

The documentation says not to set NODE_TLS_REJECT_UNAUTHORIZED=0.

## Sources

- [Claude Code: Error reference](https://code.claude.com/docs/en/errors.md)
- [Claude Code: Enterprise network configuration](https://code.claude.com/docs/en/network-config.md)

Checked on 29 October 2026.

## Related guides

- [“Unable to connect to API” in Claude Code on Mac](https://kilobat.app/guides/claude-code-unable-to-connect-to-api): Claude Code prints Unable to connect to API when a request does not reach api.anthropic.com.
- [“UNABLE_TO_GET_ISSUER_CERT_LOCALLY” on Mac](https://kilobat.app/guides/npm-unable-to-get-issuer-cert-locally): UNABLE_TO_GET_ISSUER_CERT_LOCALLY means that Node.js cannot find the authority that signed a certificate.
- [Corporate proxy certificates break Terminal tools on a Mac](https://kilobat.app/guides/corporate-proxy-certificates): Some company networks inspect HTTPS traffic.
- [“curl: (60) SSL certificate problem” on Mac](https://kilobat.app/guides/curl-60-ssl-certificate-problem): curl exit code 60 reports a failed step.
