Homebrew, Docker, Python & Node.js CA trust behind an SWG on Mac
Why Homebrew, Docker Desktop, Node.js, Python, git, and curl reject SWG-signed TLS certificates on macOS—and how to configure CA bundles vs. SWG bypass.
SWG bar · Updated
On a corporate Mac behind HTTPS break-and-inspect, each developer runtime validates TLS certificates differently. While Safari and Chrome consult macOS Keychain, CLI tools and containers often use their own CA bundles—causing sudden build failures across package managers and SDKs.
Why different Mac developer tools fail selectively
| Tool / Runtime | Default trust store on macOS | Common environment variable or setting |
|---|---|---|
| Node.js / npm / yarn / pnpm | Compiled-in Mozilla CA bundle | NODE_EXTRA_CA_CERTS=/path/to/corp-ca.pem |
| Python / pip / uv / requests | certifi bundle or OpenSSL CA path |
SSL_CERT_FILE / REQUESTS_CA_BUNDLE |
| git | OpenSSL or Secure Transport depending on build | git config --global http.sslCAInfo /path/to/corp-ca.pem |
curl / Homebrew (brew) |
macOS Secure Transport or OpenSSL CA bundle | HOMEBREW_CURLRC / CURL_CA_BUNDLE (check curl --version) |
| Docker Desktop / Containers | Linux VM & image /etc/ssl/certs (not macOS Keychain) |
Add corporate CA to Docker VM / image trust store |
1. Identify which registry or API hostname is intercepted
Before editing shell profiles or container builds, confirm which exact external hostnames are undergoing SSL inspection rather than failing due to DNS or firewall blocks:
swgbar domains list --status confirmed
swgbar probe registry.npmjs.org
swgbar probe pypi.org
swgbar probe ghcr.io
Note that package managers frequently redirect downloads across multiple hosts (for example formulae.brew.sh → ghcr.io, or github.com → objects.githubusercontent.com). See Bypass SWG for multi-domain web apps, SSO, CDNs & APIs.
2. Decide between CA bundle configuration, TLS exception, or SWG bypass
- Append the enterprise root CA PEM: When corporate policy requires all traffic to undergo SWG decryption, export the exact root CA identified in SWG bar → Certificates and configure
NODE_EXTRA_CA_CERTS,SSL_CERT_FILE,REQUESTS_CA_BUNDLE, orhttp.sslCAInfoper your IT security guidance. Never disable TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0orsslVerify=false). - Request an IT TLS inspection exception: Recommended for shared registries, Docker base images, or tools with strict certificate pinning where maintaining custom CA bundles across CI and local machines is brittle.
- Use per-domain SWG bypass on authorized networks: When you administer or are authorized to bypass specific hosts on your Mac, enable Bypass SWG in SWG bar (or
swgbar bypass enable <domain>) and restart the CLI process.
Compare workflows before changing system defaults
For step-by-step CERTIFICATE_VERIFY_FAILED remediation, read Fix SWG TLS & SSL certificate errors in CLI and AI tools on a Mac. To compare local routing rules with gateway policy exclusions, review SWG bypass vs. TLS inspection exception.