# CLAUDE_CODE_CLIENT_CERT

> It gives Claude Code a certificate to prove who it is.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_CLIENT_KEY, CLAUDE_CODE_CLIENT_KEY_PASSPHRASE, Claude Code mTLS

## Think of it like

It is like you show your own badge at a door that checks each one.

## Definition

CLAUDE_CODE_CLIENT_CERT gives the path to a client certificate. With it, Claude Code can prove who it is to a gateway. A second variable, CLAUDE_CODE_CLIENT_KEY, gives the path to its private key. If that key is locked, a third one holds the pass phrase. A gateway that asks each caller for a certificate needs these.

## Example

Emma's bank lets no program reach its gateway without a certificate. Her laptop sets the cert and key paths, and Claude Code gets through.

## Example code

```bash
export CLAUDE_CODE_CLIENT_CERT=~/certs/me.crt
export CLAUDE_CODE_CLIENT_KEY=~/certs/me.key
claude
```

Show your cert to a gateway that asks for one.

## Why it matters

Some networks trust a certificate, not a password. This is how Claude Code shows one.

## Common mistake

Setting only the certificate. The private key is needed too, or the check fails.

## Three principles

- **Cert path.** Who you are.
- **Key path.** Proves it.
- **Passphrase.** If the key is locked.

## Related terms

- [Transport Layer Security (TLS)](https://learn.benibix.com/term/infrastructure/tls)
- [LLM Gateway](https://learn.benibix.com/term/development/llm-gateway)
- [CLAUDE_CODE_CERT_STORE](https://learn.benibix.com/term/ai/claude-code-cert-store-variable)

![A request goes out through your proxy and gateway, with the headers and cert you set.](https://learn.benibix.com/diagrams/env-network-path.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-client-cert-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
