ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

Zertifikatsfehler auf Firmen-Macs beheben: So laufen Claude Code, Cursor, Git und npm wieder

Wer auf dem Arbeits-Mac mit selbstsignierten Unternehmenszertifikaten arbeitet, stößt bei Claude Code, Cursor, npm oder Git schnell auf Fehler wie UNABLE_TO_GET_ISSUER_CERT_LOCALLY. Mit den richtigen Einstellungen für die Zertifikatskette lässt sich das Problem lösen.

dev.toMontag 04:15 · 23.11.DE5 Min. Lesezeit
Bild: dev.to

Du richtest Claude Code ein oder öffnest Cursor auf deinem Firmen-MacBook, sendest deinen ersten Prompt oder führst npm install oder git push aus und stößt sofort auf eine Wand:

Währenddessen öffnen Safari und Chrome api.anthropic.com, github.com und registry.npmjs.org ohne eine einzige Warnung.

Diese Diskrepanz wird fast immer durch unternehmensseitiges HTTPS Break-and-Inspect über einen Secure Web Gateway (SWG) wie Zscaler, Netskope, Cloudflare Zero Trust oder Palo Alto GlobalProtect verursacht. Hier erfährst du, warum dein Browser erfolgreich ist, während deine KI-Coding-Tools und CLIs fehlschlagen, und wie du das Problem auf macOS sauber behebst, ohne zu unsicheren Abkürzungen wie NODE_TLS_REJECT_UNAUTHORIZED=0 zu greifen.

Wenn ein Unternehmens-SWG verschlüsselten Web-Traffic inspiziert, beendet es die ausgehende TLS-Verbindung am Gateway, untersucht die Nutzdaten und signiert die Antwort mit einer Enterprise-Root-CA neu, die per MDM auf deinen Mac in den macOS-Keychain verschoben wurde.

Safari und Chrome lesen den macOS-Keychain automatisch und akzeptieren daher stillschweigend die neu signierten Leaf-Zertifikate des Gateways. Developer-Runtimes verhalten sich dagegen nicht einheitlich:

Weil Node.js, Electron-Hilfsprozesse, Python und OpenSSL-basiertes Git den macOS-Keychain standardmäßig ignorieren, schlägt die Zertifikatsvalidierung in dem Moment fehl, in dem dein SWG eine LLM-API oder Package-Registry abfängt.

Moderne KI-Coding-Workflows kommunizieren mit mehr als einer Domain: Inference-APIs, OAuth-Sign-in-Endpunkte, Extension-Marktplätze, MCP-Server und Package-Registries werden von deiner SWG-Richtlinie möglicherweise nicht alle gleich behandelt. Prüfe den tatsächlichen Issuer, bevor du Konfigurationen änderst:

# Inspect the live TLS issuer and subject for an endpoint openssl s_client -connect api.anthropic.com:443 -servername api.anthropic.com \ < /dev/null 2 > /dev/null \ | openssl x509 -noout -issuer -subject -fingerprint -sha256 Enter fullscreen mode Exit fullscreen mode Wenn die Zeile issuer= deinen Firmennamen oder einen Gateway-Hersteller (wie Zscaler, Netskope oder Cloudflare Gateway) anstelle einer öffentlichen CA wie DigiCert, Google Trust Services oder Let's Encrypt anzeigt, ist die TLS-Inspektion auf diesem Hostnamen aktiv.

Um alle abgefangenen Hostnamen auf deinem Mac auf einmal zu prüfen, ohne sekundäre Auth- oder CDN-Hosts manuell raten zu müssen, kannst du sie auch lokal mit dem SWG bar CLI unter macOS 14+ (Apple silicon) abfragen:

swgbar domains list --status confirmed --json swgbar probe api.anthropic.com --json swgbar domains detail registry.npmjs.org --json Enter fullscreen mode Exit fullscreen mode Schritt 2: Exportiere deine Enterprise-Root-CA und erstelle ein sauberes Bundle Widerstehe dem Impuls, export NODE_TLS_REJECT_UNAUTHORIZED=0 in die ~/.zshrc zu schreiben oder git config --global http.sslVerify false zu setzen. Das globale Deaktivieren der Zertifikatsprüfung entfernt die TLS-Authentizitätsprüfungen für jeden API-Key, jedes OAuth-Token und jeden Package-Download und verwandelt jedes Café-WLAN oder jeden falsch konfigurierten Proxy in ein stilles Credential-Leak.

Stattdessen exportiere die Root-CA deines Unternehmens aus dem macOS-System-Keychain (oder besorge dir die offizielle PEM-Datei von deinem IT-Sicherheitsteam):

mkdir -p ~/.certs # Replace "Zscaler" with the exact issuer CN observed in Step 1 security find-certificate -a -c "Zscaler" -p /Library/Keychains/System.keychain \ > ~/.certs/corporate-ca.pem # Sanity-check that the exported PEM contains valid certificate(s) grep -c "BEGIN CERTIFICATE" ~/.certs/corporate-ca.pem openssl x509 -in ~/.certs/corporate-ca.pem -noout -subject -issuer -dates Enter fullscreen mode Exit fullscreen mode Eine subtile macOS-Falle: NODE_EXTRA_CA_CERTS hängt an die integrierte öffentliche CA-Liste von Node an, während SSL_CERT_FILE, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE und git http.sslCAInfo den Trust Store ersetzen. Wenn du Git oder Python auf eine PEM-Datei zeigst, die nur deinen Corporate-Root enthält, wird plötzlich jede Domain, die von der SWG-Inspektion ausgenommen ist, die Validierung fehlschlagen.

Erstelle mit dem System-Root-Bundle von macOS ein kombiniertes Bundle, damit sowohl inspizierte als auch Public-CA-Domains sauber verifiziert werden:

cat /etc/ssl/cert.pem ~/.certs/corporate-ca.pem > ~/.certs/combined-ca.pem Enter fullscreen mode Exit fullscreen mode Schritt 3: Konfiguriere Claude Code, Cursor, npm, Git und Python Claude Code, Node.js und npm Füge NODE_EXTRA_CA_CERTS zur ~/.zshrc hinzu (beachte, dass NODE_EXTRA_CA_CERTS npm, yarn, pnpm und npx automatisch repariert, ohne npm config set cafile zu benötigen):

# ~/.zshrc export NODE_EXTRA_CA_CERTS = "$HOME/.certs/corporate-ca.pem" Enter fullscreen mode Exit fullscreen mode Speziell für Claude Code deklariere die Zertifikats-Umgebung zusätzlich in ~/.claude/settings.json, damit Subshells und von der IDE gestartete Sitzungen sie zuverlässig erben:

{ "env": { "NODE_EXTRA_CA_CERTS": "/Users/<your-user>/.certs/corporate-ca.pem", "CLAUDE_CODE_CERT_STORE": "bundled,system" } } Enter fullscreen mode Exit fullscreen mode Cursor Öffne die Command Palette ( Cmd + Shift + P ) → Preferences: Open User Settings (JSON) und aktiviere die macOS-Systemzertifikate. Viele Unternehmens-SWGs blockieren zudem die langlebigen HTTP/2-Streaming-Antworten, die KI-Agenten verwenden, sodass das Deaktivieren von HTTP/2 hängende Completions oft behebt:

{ "http.experimental.systemCertificatesV2": true, "cursor.general.disableHttp2": true } Enter fullscreen mode Exit fullscreen mode Weil GUI-Apps, die über Spotlight oder das Dock geöffnet werden, keine Variablen aus der ~/.zshrc erben, solltest du Cursor beim Verifizieren von NODE_EXTRA_CA_CERTS vollständig beenden ( Cmd + Q ) und aus dem Terminal starten ( open -a Cursor ).

Zeige mit Runtimes, die ihren CA-Store ersetzen, auf das kombinierte PEM-Bundle:

# ~/.zshrc export SSL_CERT_FILE = "$HOME/.certs/combined-ca.pem" export REQUESTS_CA_BUNDLE = "$HOME/.certs/combined-ca.pem" export CURL_CA_BUNDLE = "$HOME/.certs/combined-ca.pem" # Apply once for Git git config --global http.sslCAInfo "$HOME/.certs/combined-ca.pem" Enter fullscreen mode Exit fullscreen mode Lade deine Shell neu ( source ~/.zshrc ) und teste erneut. Zum Thema Docker Desktop VM Trust und Homebrew-spezifische Sonderfälle siehe den Homebrew-, Docker-, Python- und Node.js-CA-Trust-Guide für macOS.

Selbst mit dem richtig konfigurierten PEM-Bundle brechen einige Developer-Tools hinter Break-and-Inspect weiterhin, und zwar wegen striktem Certificate Pinning, mTLS-Client-Auth oder Proxy-Buffering bei SSE- und WebSocket-Streams. Wähle den passenden Weg für deine Sicherheitsrichtlinie:

Wenn du auf einem Mac und in einem Netzwerk arbeitest, in dem ein Per-Domain-Bypass gemäß der Acceptable-Use-Policy deiner Organisation erlaubt ist, kannst du in SWG bar einen einzelnen Hostnamen umschalten, ohne deinen VPN abzubauen oder den Device Posture zu beschädigen:

swgbar bypass enable api.anthropic.com swgbar bypass status --json swgbar probe api.anthropic.com --json Enter fullscreen mode Exit fullscreen mode Starte Claude Code oder Cursor neu, sobald Bypassing angezeigt wird, damit offene Keep-Alive-Sockets sauber neu verbinden. Beachte, dass Bypass-Regeln strikt pro Hostnamen gelten (ein Bypass für api.anthropic.com deckt keine OAuth- oder npm-Hosts ab), und falls deine Firmen-Firewall direkten ausgehenden IPv4-Traffic blockiert, deaktiviere die Regel ( swgbar bypass disable api.anthropic.com ) und fordere stattdessen eine IT-Ausnahme der Kategorie Do Not Decrypt an.

Unter macOS 14+ (Apple silicon) liefert SWG bar einen lokalen stdio-MCP-Server, sodass Claude Code oder Cursor beobachtete Domains inspizieren, MITM-Root-CAs verifizieren und On-Demand-TLS-Probes direkt aus deiner Coding-Sitzung heraus ausführen können: alles läuft lokal gegen die Datenbank deines Macs, ganz ohne Cloud-Upload:

claude mcp add swgbar -- /Applications/SWGBar.app/Contents/MacOS/swgbar mcp Enter fullscreen mode Exit fullscreen mode Oder füge es zur Datei.cursor/mcp.json hinzu:

{ "mcpServers": { "swgbar": { "command": "/Applications/SWGBar.app/Contents/MacOS/swgbar", "args": [ "mcp" ] } } } Enter fullscreen mode Exit fullscreen mode (Wenn du diagnostische Ausgaben in öffentlichen GitHub-Issues teilst, entferne immer interne Firmennamen und Root-CA-Fingerabdrücke.)

Für die vollständige Troubleshooting-Checkliste, einschließlich Multi-Domain-OAuth/API-Verifizierung und MCP-Tool-Referenz, wirf einen Blick auf den Claude Code- und Cursor-SWG-Guide für macOS.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

You set up Claude Code or open Cursor on your company MacBook, send your first prompt—or run npm install or git push —and immediately hit a wall:

Meanwhile, Safari and Chrome open api.anthropic.com, github.com, and registry.npmjs.org without a single warning.

That discrepancy is almost always caused by corporate HTTPS break-and-inspect from a Secure Web Gateway (SWG) such as Zscaler, Netskope, Cloudflare Zero Trust, or Palo Alto GlobalProtect. Here is why your browser succeeds while your AI coding tools and CLIs break, and how to fix it cleanly on macOS without reaching for insecure shortcuts like NODE_TLS_REJECT_UNAUTHORIZED=0.

When an enterprise SWG inspects encrypted web traffic, it terminates the outbound TLS connection at the gateway, inspects the payload, and re-signs the response with an enterprise Root CA pushed to your Mac via MDM into macOS Keychain.

Safari and Chrome read macOS Keychain automatically, so they silently accept the gateway's re-signed leaf certificates. Developer runtimes do not behave uniformly:

Because Node.js, Electron helper processes, Python, and OpenSSL-linked Git ignore macOS Keychain by default, the moment your SWG intercepts an LLM API or package registry, certificate validation fails.

Modern AI coding workflows talk to more than one domain—inference APIs, OAuth sign-in endpoints, extension marketplaces, MCP servers, and package registries may not all be treated identically by your SWG policy. Confirm the live issuer before changing configs:

# Inspect the live TLS issuer and subject for an endpoint openssl s_client -connect api.anthropic.com:443 -servername api.anthropic.com \ < /dev/null 2 > /dev/null \ | openssl x509 -noout -issuer -subject -fingerprint -sha256 Enter fullscreen mode Exit fullscreen mode If the issuer= line shows your company name or a gateway vendor (such as Zscaler, Netskope, or Cloudflare Gateway) instead of a public CA like DigiCert, Google Trust Services, or Let's Encrypt, TLS inspection is active on that hostname.

To audit all intercepted hostnames across your Mac at once—without manually guessing secondary auth or CDN hosts—you can also query them locally with the SWG bar CLI on macOS 14+ (Apple silicon):

swgbar domains list --status confirmed --json swgbar probe api.anthropic.com --json swgbar domains detail registry.npmjs.org --json Enter fullscreen mode Exit fullscreen mode Step 2: Export your enterprise Root CA and build a clean bundle Resist the urge to put export NODE_TLS_REJECT_UNAUTHORIZED=0 in ~/.zshrc or set git config --global http.sslVerify false. Disabling certificate verification globally strips TLS authenticity checks across every API key, OAuth token, and package download—turning any coffee-shop Wi-Fi or misconfigured proxy into a silent credential leak.

Instead, export your corporate Root CA from the macOS System Keychain (or obtain the official PEM file from your IT security team):

mkdir -p ~/.certs # Replace "Zscaler" with the exact issuer CN observed in Step 1 security find-certificate -a -c "Zscaler" -p /Library/Keychains/System.keychain \ > ~/.certs/corporate-ca.pem # Sanity-check that the exported PEM contains valid certificate(s) grep -c "BEGIN CERTIFICATE" ~/.certs/corporate-ca.pem openssl x509 -in ~/.certs/corporate-ca.pem -noout -subject -issuer -dates Enter fullscreen mode Exit fullscreen mode One subtle macOS gotcha: NODE_EXTRA_CA_CERTS appends to Node's built-in public CA list, whereas SSL_CERT_FILE, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE, and git http.sslCAInfo replace the trust store. If you point Git or Python to a PEM file that only contains your corporate root, any domain excluded from SWG inspection will suddenly fail validation.

Build a combined bundle using macOS's system root bundle so both inspected and public-CA domains verify cleanly:

cat /etc/ssl/cert.pem ~/.certs/corporate-ca.pem > ~/.certs/combined-ca.pem Enter fullscreen mode Exit fullscreen mode Step 3: Configure Claude Code, Cursor, npm, Git, and Python Claude Code, Node.js, and npm Add NODE_EXTRA_CA_CERTS to ~/.zshrc (note that NODE_EXTRA_CA_CERTS fixes npm, yarn, pnpm, and npx automatically without needing npm config set cafile ):

# ~/.zshrc export NODE_EXTRA_CA_CERTS = "$HOME/.certs/corporate-ca.pem" Enter fullscreen mode Exit fullscreen mode For Claude Code specifically, also declare the certificate environment in ~/.claude/settings.json so subshells and IDE-spawned sessions inherit it reliably:

{ "env": { "NODE_EXTRA_CA_CERTS": "/Users/<your-user>/.certs/corporate-ca.pem", "CLAUDE_CODE_CERT_STORE": "bundled,system" } } Enter fullscreen mode Exit fullscreen mode Cursor Open the Command Palette ( Cmd + Shift + P ) → Preferences: Open User Settings (JSON) and enable macOS system certificates. Many corporate SWGs also stall long-lived HTTP/2 streaming responses used by AI agents, so disabling HTTP/2 often clears hanging completions:

{ "http.experimental.systemCertificatesV2": true, "cursor.general.disableHttp2": true } Enter fullscreen mode Exit fullscreen mode Because GUI apps opened from Spotlight or Dock do not inherit ~/.zshrc variables, fully quit Cursor ( Cmd + Q ) and launch it from Terminal ( open -a Cursor ) when verifying NODE_EXTRA_CA_CERTS.

Point runtimes that replace their CA store at the combined PEM bundle:

# ~/.zshrc export SSL_CERT_FILE = "$HOME/.certs/combined-ca.pem" export REQUESTS_CA_BUNDLE = "$HOME/.certs/combined-ca.pem" export CURL_CA_BUNDLE = "$HOME/.certs/combined-ca.pem" # Apply once for Git git config --global http.sslCAInfo "$HOME/.certs/combined-ca.pem" Enter fullscreen mode Exit fullscreen mode Reload your shell ( source ~/.zshrc ) and re-test. For Docker Desktop VM trust and Homebrew-specific edge cases, see the Homebrew, Docker, Python & Node.js CA trust guide on macOS.

Even with the right PEM bundle configured, some developer tools still break behind break-and-inspect because of strict certificate pinning, mTLS client auth, or proxy buffering on SSE/WebSocket streams. Choose the right path for your security policy:

If you are working on a Mac and network where per-domain bypass is permitted by your organization's acceptable-use policy, you can toggle a single hostname in SWG bar without tearing down your VPN or breaking device posture:

swgbar bypass enable api.anthropic.com swgbar bypass status --json swgbar probe api.anthropic.com --json Enter fullscreen mode Exit fullscreen mode Restart Claude Code or Cursor after Bypassing appears so open keep-alive sockets reconnect cleanly. Keep in mind that bypass rules are strictly per-hostname (bypassing api.anthropic.com does not cover OAuth or npm hosts), and if your corporate firewall blocks direct outbound IPv4 traffic, disable the rule ( swgbar bypass disable api.anthropic.com ) and request an IT Do Not Decrypt exception instead.

On macOS 14+ (Apple silicon), SWG bar ships a local stdio MCP server so Claude Code or Cursor can inspect observed domains, verify MITM root CAs, and run on-demand TLS probes directly from your coding session—everything runs locally against your Mac's database with no cloud upload:

claude mcp add swgbar -- /Applications/SWGBar.app/Contents/MacOS/swgbar mcp Enter fullscreen mode Exit fullscreen mode Or add it to.cursor/mcp.json:

{ "mcpServers": { "swgbar": { "command": "/Applications/SWGBar.app/Contents/MacOS/swgbar", "args": [ "mcp" ] } } } Enter fullscreen mode Exit fullscreen mode (When sharing diagnostic output in public GitHub issues, always scrub internal corporate hostnames and root CA fingerprints.)

For the full troubleshooting checklist—including multi-domain OAuth/API verification and MCP tool reference—check out the Claude Code & Cursor SWG guide on macOS.

Originaltitel: Fixing "unable to get local issuer certificate" in Claude Code, Cursor, Git & npm on a Work MacQuelle: dev.to (dev.to). Original öffnen