Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 3 min read

Fix "unable to get local issuer certificate" & "x509" SSL Errors on Mac Behind Zscaler, Netskope & Cloudflare (Git, npm, Python, Docker, AI CLIs)

If you code on a company-managed MacBook, you have almost certainly seen browsers like Chrome and Safari work fine while your terminal explodes with: Git / curl: SSL certificate problem: unable to get local issuer cer

If you code on a company-managed MacBook, you have almost certainly seen browsers like Chrome and Safari work fine while your terminal explodes with:

  • Git / curl: SSL certificate problem: unable to get local issuer certificate
  • Node.js / npm / pnpm / Claude Code / Cursor / Codex: SELF_SIGNED_CERT_IN_CHAIN or UNABLE_TO_VERIFY_LEAF_SIGNATURE
  • Python / pip / uv: [SSL: CERTIFICATE_VERIFY_FAILED]
  • Docker Desktop / Go: x509: certificate signed by unknown authority

This happens because corporate MDM pushes your company's Secure Web Gateway (SWG) root CA (Zscaler, Cloudflare Gateway, Netskope, Cisco Umbrella, Palo Alto Prisma Access, or Fortinet) into the macOS System Keychain, which browsers read automaticallyβ€”while developer runtimes ship isolated CA bundles.

Quick shortcut: We built a 100% client-side Free Corporate SWG & SSL Error Decoder (nothing is uploaded to any server). Paste your raw terminal error or openssl output to detect the SWG vendor and copy the exact macOS fix commands.

Step 1: Identify Which Corporate CA Is Intercepting Your Mac

Before editing configs, verify which root CA is signing TLS chains on your Mac:

openssl s_client -connect api.github.com:443 -servername api.github.com </dev/null 2>/dev/null | openssl x509 -noout -issuer -subject

If issuer= shows Zscaler, Cloudflare, *.goskope.com (Netskope), Cisco Umbrella, Fortinet_CA_SSL, or an internal Forward Trust CA instead of DigiCert / Let's Encrypt / Google Trust Services, HTTPS break-and-inspect is active. You can also paste that line into our 30-Second Work Mac SSL Self-Check to see what is intercepted and what your employer can see (including Incognito windows).

Step 2: Export Your Corporate Root CA Safely (Never Disable SSL!)

Never run git config http.sslVerify false or NODE_TLS_REJECT_UNAUTHORIZED=0β€”that turns off TLS verification globally. Instead, export your corporate root certificate from System Keychain (replace "Zscaler" with your actual issuer from Step 1):

mkdir -p "$HOME/.certs"
security find-certificate -c "Zscaler" -p /Library/Keychains/System.keychain > "$HOME/.certs/corporate-swg-root.pem"

Step 3: Exact Copy-Paste Fixes by Runtime on macOS

1. Git, Node.js, npm, pnpm, Yarn & AI Coding CLIs (Claude Code, Cursor, Codex, Copilot, Gemini CLI)

git config --global http.sslCAInfo "$HOME/.certs/corporate-swg-root.pem"
echo 'export NODE_EXTRA_CA_CERTS="$HOME/.certs/corporate-swg-root.pem"' >> ~/.zshrc
echo 'export SSL_CERT_FILE="$HOME/.certs/corporate-swg-root.pem"' >> ~/.zshrc
source ~/.zshrc

(Gotcha: macOS Dock apps like VS Code or Cursor don't inherit ~/.zshrcβ€”launch them from Terminal with code . or cursor ., or configure "http.systemCertificates": true.)

Full guides: Fix Git & npm SSL errors on Mac Β· Fix GitHub Copilot, Codex & Gemini CLI SSL errors

2. Python (pip, uv, requests)

# Fast modern options (read macOS System Keychain directly):
export UV_NATIVE_TLS=true
pip config set global.use-feature truststore

# Or append corporate CA to certifi for requests/httpx:
CERTIFI_CA=$(python3 -c "import certifi; print(certifi.where())")
cat "$CERTIFI_CA" "$HOME/.certs/corporate-swg-root.pem" > "$HOME/.certs/python-combined-ca.pem"
export REQUESTS_CA_BUNDLE="$HOME/.certs/python-combined-ca.pem"

3. Docker Desktop (x509: certificate signed by unknown authority)

  1. Fully quit and restart Docker Desktop so it re-syncs macOS System Keychain roots for docker pull.
  2. Inside docker build containers (which do not share macOS Keychain):
COPY corporate-swg-root.pem /usr/local/share/ca-certificates/corporate-swg.crt
RUN update-ca-certificates

Full guide: Fix Python & Docker x509 SSL errors on Mac

Step 4: Skip Juggling CA Bundles β€” Detect & Bypass Per Domain on macOS

Even after configuring CA bundles, certificate-pinned apps, mTLS clients, and streaming LLM responses (SSE) still break behind SWG break-and-inspectβ€”and killing Zscaler or Netskope fails under MDM / Tamper Protection.

We built SWG bar (macOS 14+ Apple Silicon menu bar app, 14-day free trial) to:

  1. Show continuously in your menu bar which exact domains are decrypted by Zscaler, Cloudflare WARP, Netskope, Cisco Umbrella, Palo Alto, or Fortinet.
  2. Bypass a single broken hostname in one click (swgbar bypass enable api.github.com)β€”while keeping your corporate VPN and SSO running.
  3. Expose local CLI & MCP tools so Claude Code, Cursor, or Codex can check certificate evidence directly.

Useful free resources:

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.