Source: https://swgbar.com/en/guides/ai-coding-agents-claude-code-cursor-swg-macos/
Language: en

# Fix Claude Code & Cursor 'unable to get local issuer certificate' on Mac (SWG & MCP)

Fix Claude Code and Cursor unable to get local issuer certificate errors behind Zscaler, Netskope, or corporate SWGs on macOS—plus connect SWG bar MCP and per-domain bypass.

SWG bar · Updated November 19, 2026

If **Claude Code**, **Cursor**, **Windsurf**, or **Claude Desktop** fails on your work Mac with `unable to get local issuer certificate`, `UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `self-signed certificate in certificate chain`, or `CERTIFICATE_VERIFY_FAILED`, your corporate Secure Web Gateway (such as Zscaler, Netskope, or Cloudflare Gateway) is performing **SSL/HTTPS inspection** and re-signing API responses with an enterprise root CA that Node.js and Electron runtimes do not trust by default.

Below are the two safe fixes on macOS—configuring enterprise CA trust (`NODE_EXTRA_CA_CERTS` / Cursor system certificates) or enabling per-domain SWG bypass on authorized networks—plus how to connect SWG bar’s built-in **MCP server** so your AI coding agent can diagnose inspected domains automatically.

## 1\. Confirm which LLM or registry hostnames are intercepted

Before editing shell profiles or settings, verify which exact hostnames (`api.anthropic.com`, `api2.cursor.sh`, `registry.npmjs.org`, OAuth sign-in hosts, or MCP endpoints) are being re-signed on your Mac using **SWG bar → Domains** or the `--json` [CLI](<https://swgbar.com/en/cli/>):

```
swgbar overview --json
swgbar domains list --status confirmed --json
swgbar probe api.anthropic.com --json
swgbar domains detail registry.npmjs.org --json
```

Pay close attention to secondary endpoints: an AI IDE often contacts separate hostnames for model inference, authentication, telemetry, and extension marketplaces.

## 2\. Fix `unable to get local issuer certificate` in Claude Code & Cursor

Avoid setting `NODE_TLS_REJECT_UNAUTHORIZED=0`, which disables TLS validation globally and exposes API keys on untrusted networks. Choose one of the two safe paths below:

### Option A: Configure enterprise root CA trust (keeps SWG decryption active)

Export your corporate/Zscaler/Netskope root CA as a PEM file (for example `$HOME/.certs/corporate-ca.pem`) from Keychain Access or IT, then configure each tool:

*   **Claude Code** (`~/.zshrc` and `~/.claude/settings.json`):

```
export NODE_EXTRA_CA_CERTS="$HOME/.certs/corporate-ca.pem"
```

```
{
  "env": {
    "NODE_EXTRA_CA_CERTS": "/Users/<your-user>/.certs/corporate-ca.pem",
    "CLAUDE_CODE_CERT_STORE": "bundled,system"
  }
}
```

*   **Cursor** (`Preferences: Open User Settings (JSON)`): Enable system certificates (and optionally disable HTTP/2 if the SWG proxy breaks streaming), then fully quit (`Cmd + Q`) and relaunch Cursor from Terminal so it inherits `NODE_EXTRA_CA_CERTS`:

```
{
  "http.experimental.systemCertificatesV2": true,
  "cursor.general.disableHttp2": true
}
```

For Zscaler, Netskope, and Cloudflare-specific CA bundle commands, also see [Zscaler SSL inspection on Mac](<https://swgbar.com/en/guides/zscaler-ssl-inspection-bypass-mac/>), [Netskope SSL inspection on Mac](<https://swgbar.com/en/guides/netskope-ssl-inspection-bypass-mac/>), and [Fix SWG TLS & SSL certificate errors in CLI and AI tools](<https://swgbar.com/en/guides/swg-tls-certificate-errors-macos/>).

### Option B: Enable per-domain SWG bypass on an authorized Mac

When working on a network you administer or are authorized to configure—especially if HTTP/2 streaming or certificate pinning still breaks even with `NODE_EXTRA_CA_CERTS`—toggle per-hostname bypass over your Mac’s physical `Hardware` IPv4 interface via **SWG bar → Domains → Bypass SWG → Enable** or Terminal:

```
swgbar bypass enable api.anthropic.com
swgbar bypass status --json
swgbar probe api.anthropic.com --json
```

Restart Claude Code or Cursor after **Bypassing** appears so existing sockets reopen cleanly. If your corporate firewall blocks direct outbound connections, disable bypass (`swgbar bypass disable <domain>`) and use Option A or request an IT **Do Not Decrypt** rule. Follow [How to bypass SWG on a Mac](<https://swgbar.com/en/guides/how-to-bypass-swg/>) for full setup and restart behavior.

## 3\. Connect SWG bar MCP to Claude Code or Cursor

Ensure [SWG bar is installed](<https://swgbar.com/en/install/>) in `/Applications/SWGBar.app` and running on macOS 14+ (Apple silicon). Register the local stdio MCP server with one command for **Claude Code**:

```
claude mcp add swgbar -- /Applications/SWGBar.app/Contents/MacOS/swgbar mcp
```

Or add the server block to `.cursor/mcp.json` (for **Cursor**) or `claude_desktop_config.json` (for **Claude Desktop**):

```
{
  "mcpServers": {
    "swgbar": {
      "command": "/Applications/SWGBar.app/Contents/MacOS/swgbar",
      "args": ["mcp"]
    }
  }
}
```

See the [full MCP guide](<https://swgbar.com/en/mcp/>) for all exposed tool areas (Overview, Domains, Certificates, SWG Bypass, On-Demand Probes, Browser Companion, and App Preferences).

## Keep local evidence boundaries in mind

SWG bar’s MCP server runs locally over stdio against your Mac’s local database—nothing is sent to SWG bar cloud servers. Still, avoid pasting raw company root CA details or private internal hostnames into public bug reports; review [SWG bar permissions & local privacy](<https://swgbar.com/en/guides/macos-network-extension-privacy-probe-limits/>) before sharing diagnostic logs.

## Keep reading

*   [How to Bypass SWG on a Mac (One-Click Domain Bypass & CLI)](<https://swgbar.com/en/guides/how-to-bypass-swg/>)
*   [How to Bypass SSL Inspection on a Mac (Corporate SWG & Per-Domain Fix)](<https://swgbar.com/en/guides/bypass-ssl-inspection-mac/>)
*   [How to Bypass HTTPS & TLS Inspection on macOS (Break-and-Inspect Guide)](<https://swgbar.com/en/guides/bypass-https-tls-inspection-mac/>)
*   [How to Bypass Corporate Proxy & SWG SSL Inspection on a Mac](<https://swgbar.com/en/guides/bypass-corporate-proxy-ssl-inspection-mac/>)
*   [How to tell if your Mac is intercepted by an SWG (HTTPS & SSL inspection)](<https://swgbar.com/en/guides/detect-https-inspection/>)
*   [How to Check if Your Employer or Work Mac Is Intercepting HTTPS (SSL Inspection)](<https://swgbar.com/en/guides/check-if-work-mac-intercepting-https/>)
*   [SSL Inspection Checker for Mac: Menu Bar Tool to Detect HTTPS Interception](<https://swgbar.com/en/guides/ssl-inspection-checker-mac/>)
*   [Zscaler SSL Inspection on Mac: How to Check & Bypass per Domain](<https://swgbar.com/en/guides/zscaler-ssl-inspection-bypass-mac/>)
*   [Netskope SSL Inspection on Mac: Check Decryption & Bypass per Domain](<https://swgbar.com/en/guides/netskope-ssl-inspection-bypass-mac/>)
*   [Cloudflare WARP & Zero Trust TLS Inspection on Mac: Detect & Bypass](<https://swgbar.com/en/guides/cloudflare-warp-tls-inspection-mac/>)
*   [Confirmed vs. Suspected HTTPS inspection in SWG bar](<https://swgbar.com/en/guides/confirmed-vs-suspected-https-inspection/>)
*   [Inspect MITM root certificates & issuers in SWG bar](<https://swgbar.com/en/guides/inspect-mitm-root-certificates-macos/>)
*   [Enterprise SWG & MDM HTTPS inspection on a Mac](<https://swgbar.com/en/guides/enterprise-swg-https-inspection-macos/>)
*   [SWG bypass vs. TLS inspection exception (break and inspect)](<https://swgbar.com/en/guides/swg-bypass-vs-tls-exception/>)
*   [Bypass SWG for multi-domain web apps, SSO, CDNs & APIs on Mac](<https://swgbar.com/en/guides/multi-domain-sso-api-cdn-swg-bypass/>)
*   [Fix SWG bypass Recovering, Paused & connection errors on Mac](<https://swgbar.com/en/guides/troubleshoot-swg-bypass-recovering-paused-macos/>)
*   [macOS VPN virtual interfaces vs. SWG HTTPS inspection](<https://swgbar.com/en/guides/macos-vpn-virtual-interface-vs-swg-inspection/>)
*   [Why certificate-pinned apps & mTLS break under SWG inspection](<https://swgbar.com/en/guides/certificate-pinning-mtls-swg-inspection-macos/>)
*   [Fix SWG TLS & SSL certificate errors in CLI and AI tools on a Mac](<https://swgbar.com/en/guides/swg-tls-certificate-errors-macos/>)
*   [Homebrew, Docker, Python & Node.js CA trust behind an SWG on Mac](<https://swgbar.com/en/guides/homebrew-docker-python-node-ca-trust-swg-macos/>)
*   [Verify TLS certificates with openssl & security verify-cert on Mac](<https://swgbar.com/en/guides/verify-tls-certificates-openssl-security-verify-cert-macos/>)
*   [SWG bar permissions, local privacy & TLS probe limits](<https://swgbar.com/en/guides/macos-network-extension-privacy-probe-limits/>)
*   [How SWG bar checks HTTPS inspection](<https://swgbar.com/en/how-it-works/>)
*   [Download & install SWG bar for Mac (macOS 14+)](<https://swgbar.com/en/install/>)
*   [Chrome Extension to Detect SSL & HTTPS Inspection (SWG Bar Companion)](<https://swgbar.com/en/chrome-extension/>)
*   [SWG bar CLI Guide](<https://swgbar.com/en/cli/>)
*   [SWG bar MCP Guide](<https://swgbar.com/en/mcp/>)
*   [SWG bar release information](<https://swgbar.com/en/releases/>)
*   [About SWG bar](<https://swgbar.com/en/about/>)
