---
title: "Fix curl (60), Wget & PHP Composer SSL Certificate Errors on Mac — SWG bar"
description: "Fix curl (60) SSL certificate problem, Wget verification errors & PHP Composer SSL failures behind Zscaler, Cloudflare WARP, or Netskope on Mac."
image: "https://swgbar.com/brand/swgbar-og-1200x630.png"
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://swgbar.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

Source: https://swgbar.com/en/guides/fix-curl-60-wget-php-composer-ssl-error-mac/
Language: en

# Fix curl (60), Wget & PHP Composer SSL Certificate Errors on Mac

Fix curl (60) SSL certificate problem, Wget verification errors & PHP Composer SSL failures behind Zscaler, Cloudflare WARP, or Netskope on Mac.

SWG bar · Updated December 4, 2026

When running `curl`, `wget`, PHP HTTP requests (Guzzle, Symfony HttpClient, Laravel `Http`), or `composer install` on a corporate Mac behind Zscaler, Cloudflare WARP, Netskope, Cisco Umbrella, Palo Alto GlobalProtect, or Fortinet, TLS verification frequently fails with errors like:

```
# Homebrew curl (OpenSSL backend instead of macOS Keychain)
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

# GNU Wget (brew install wget)
ERROR: cannot verify repo.packagist.org's certificate, issued by 'CN=Zscaler Intermediate Root CA ...':
  Unable to locally verify the issuer's authority.

# PHP OpenSSL stream / ext-curl / Guzzle / Laravel Http
PHP Warning: file_get_contents(): SSL operation failed with code 1.
OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed
cURL error 60: SSL certificate problem: unable to get local issuer certificate

# Composer (Packagist & dist archive downloads)
The "https://repo.packagist.org/packages.json" file could not be downloaded:
SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed
Failed to enable crypto
```

Paste your exact terminal output into the free [SWG & SSL Error Decoder](<https://swgbar.com/en/tools/tls-error-decoder/>) to pinpoint which TLS stack rejected the chain, or apply the upgrade-safe macOS fix below.

## 1\. Why `curl`, Wget & PHP Composer reject corporate SWG certificates

Safari and Chrome validate TLS certificates against macOS System Keychain, where MDM installs your company’s SWG Root CA. Homebrew web CLIs and PHP runtimes rely on separate static PEM bundles instead:

*   **Homebrew `curl` vs. Apple `/usr/bin/curl`**: Apple’s built-in `/usr/bin/curl` can consult macOS trust settings, whereas Homebrew’s `curl` (`/opt/homebrew/opt/curl/bin/curl`) links against Homebrew `openssl@3` and reads a static `cert.pem` file that does not include MDM-installed corporate root CAs. Even Apple’s `curl` fails if `CURL_CA_BUNDLE` or `SSL_CERT_FILE` is already set in your shell to an incomplete file.
*   **GNU `wget`**: Installed via Homebrew (`brew install wget`), `wget` links against Homebrew OpenSSL or GnuTLS and validates certificates exclusively against its compiled CA bundle rather than macOS Keychain.
*   **PHP & Composer (dual TLS stacks)**: Homebrew PHP, Laravel Herd, Valet, and MAMP use **two independent TLS settings** inside `php.ini`—`openssl.cafile` for PHP streams (`file_get_contents`, Composer metadata fetches) and `curl.cainfo` for `ext-curl` (Guzzle, Laravel `Http::get()`, Stripe/AWS PHP SDKs). Fixing only one leaves the other failing with `cURL error 60` or `Failed to enable crypto`.

Inspect which binaries and CA paths your Mac currently loads:

```
which -a curl wget php composer
curl --version | head -n 2
php --ini
php -r 'print_r(openssl_get_cert_locations());'
```

Never edit `/opt/homebrew/etc/ca-certificates/cert.pem` directly—the next `brew upgrade ca-certificates` silently overwrites it. And never point `SSL_CERT_FILE` or `CURL_CA_BUNDLE` at _only_ your corporate SWG root CA, or every non-inspected public HTTPS host immediately breaks.

## 2\. Build an upgrade-safe combined macOS + corporate SWG CA bundle

Create a single combined PEM file in `~/.certs/web-cli-combined-ca.pem` containing **Apple’s built-in trusted public root CAs plus your corporate SWG Root CA**:

```
mkdir -p "$HOME/.certs"

# 1. Export Apple's built-in trusted public root CAs
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain > "$HOME/.certs/web-cli-combined-ca.pem"

# 2. Append your corporate SWG Root CA (replace "Zscaler" with Cloudflare, goskope, Cisco Umbrella, Fortinet, etc.)
security find-certificate -c "Zscaler" -p /Library/Keychains/System.keychain >> "$HOME/.certs/web-cli-combined-ca.pem"
```

Because both standard public roots and your corporate SWG root live in one user-owned file, inspected endpoints (`repo.packagist.org`, `getcomposer.org`, `api.github.com`) and direct endpoints both validate cleanly across Homebrew and PHP upgrades.

## 3\. Persist CA trust for `curl`, Wget, PHP & Composer

First, export the combined bundle in `~/.zshrc` so interactive terminal sessions pick it up automatically:

```
cat <<'EOF' >> ~/.zshrc
export SSL_CERT_FILE="$HOME/.certs/web-cli-combined-ca.pem"
export CURL_CA_BUNDLE="$HOME/.certs/web-cli-combined-ca.pem"
export COMPOSER_CAFILE="$HOME/.certs/web-cli-combined-ca.pem"
EOF
source ~/.zshrc
```

Next, persist tool-level configuration so scripts, Composer, and non-interactive runners inherit the bundle even without shell variables:

*   **`curl` & `wget`**: Write the CA path into `~/.curlrc` and `~/.wgetrc`:
    
    ```
    echo "cacert = $HOME/.certs/web-cli-combined-ca.pem" >> ~/.curlrc
    echo "ca_certificate = $HOME/.certs/web-cli-combined-ca.pem" >> ~/.wgetrc
    ```
    
*   **PHP (`openssl.cafile` and `curl.cainfo`)**: Find your `Scan for additional .ini files in:` directory from `php --ini` (for example `/opt/homebrew/etc/php/8.4/conf.d/`) and create `99-corporate-ca.ini` using the **full absolute path** printed by `echo "$HOME/.certs/web-cli-combined-ca.pem"` (`php.ini` does not expand `~` or `$HOME`):
    
    ```
    [openssl]
    openssl.cafile = /Users/<your-username>/.certs/web-cli-combined-ca.pem
    
    [curl]
    curl.cainfo = /Users/<your-username>/.certs/web-cli-combined-ca.pem
    ```
    
*   **Composer**: Save the CA path globally in `~/.composer/config.json`:
    
    ```
    composer config -g cafile "$HOME/.certs/web-cli-combined-ca.pem"
    ```
    

Verify all four tools with full TLS validation enabled—**never** disable verification (`curl -k` / `--insecure`, `wget --no-check-certificate`, `composer config -g disable-tls true`, `composer config -g secure-http false`, Guzzle `'verify' => false`, or `NODE_TLS_REJECT_UNAUTHORIZED=0`):

```
curl -I https://repo.packagist.org/packages.json
wget --spider https://repo.packagist.org/packages.json
php -r 'echo strlen(file_get_contents("https://repo.packagist.org/packages.json")) . PHP_EOL;'
composer diagnose
```

## 4\. Fix PHP-FPM, Laravel Herd/Valet, PhpStorm & non-interactive shells

If `curl`, `php`, and `composer` succeed in Terminal but still throw `cURL error 60` inside local web apps, **PHP-FPM**, **Laravel Herd / Valet**, **PhpStorm**, or **VS Code**, those background services and GUI apps do not load `~/.zshrc`:

*   **Restart PHP-FPM / Herd / Valet** after adding `99-corporate-ca.ini` (for Homebrew PHP: `brew services restart php`) so web workers pick up both `openssl.cafile` and `curl.cainfo`. Verify via `php-fpm -i | grep -E 'openssl\.cafile|curl\.cainfo'`.
*   **Export for GUI IDEs** (PhpStorm, VS Code) in the current macOS login session, then restart the IDE:
    
    ```
    launchctl setenv SSL_CERT_FILE "$HOME/.certs/web-cli-combined-ca.pem"
    launchctl setenv CURL_CA_BUNDLE "$HOME/.certs/web-cli-combined-ca.pem"
    launchctl setenv COMPOSER_CAFILE "$HOME/.certs/web-cli-combined-ca.pem"
    ```
    

## 5\. Avoid recurring CA maintenance & pinned-API failures with per-domain SWG bypass

Every minor PHP upgrade moves the `conf.d` directory, corporate SWGs periodically rotate intermediate certificates, and payment or OAuth APIs that enforce strict TLS validation fail whenever HTTPS is re-signed. Where your company’s policy permits per-domain SWG bypass for developer package registries and download mirrors, [SWG bar](<https://swgbar.com/en/install/>) detects which hosts are intercepted and restores the authentic TLS certificate per domain without disabling your corporate VPN or SSO (includes a 14 actual-use-day free trial):

```
swgbar probe repo.packagist.org
swgbar bypass enable repo.packagist.org
swgbar bypass enable getcomposer.org
swgbar bypass enable api.github.com
```

Configuring other developer runtimes on the same corporate Mac? Continue with [Homebrew, Docker, Python & Node.js CA trust behind SWG on Mac](<https://swgbar.com/en/guides/homebrew-docker-python-node-ca-trust-swg-macos/>), [Fix Git & npm SSL certificate errors on Mac](<https://swgbar.com/en/guides/fix-git-npm-unable-to-get-local-issuer-certificate-mac/>), and [How to bypass SWG on a Mac](<https://swgbar.com/en/guides/how-to-bypass-swg/>).

macOS 14+ · Apple Silicon

## Stop guessing which domains your company SWG decrypts.

SWG bar checks HTTPS inspection right from your Mac’s menu bar and lets you bypass broken domains in one click—while keeping corporate VPN and SSO running.

[Start a 14-day trial for $0](<https://swgbar.com/releases/2.4.13/SWGBar-macOS-arm64.pkg>) [Decode a TLS error](<https://swgbar.com/en/tools/tls-error-decoder/>) [Free Chrome extension](<https://chromewebstore.google.com/detail/bidclnlfneemkkdeanlcbpjfdalelmbf>)

## Keep reading

*   [How to Bypass SWG on a Mac (1-Click & CLI Guide)](<https://swgbar.com/en/guides/how-to-bypass-swg/>)
*   [How to Bypass SSL Inspection on a Mac (Why Keychain & curl -k Fail)](<https://swgbar.com/en/guides/bypass-ssl-inspection-mac/>)
*   [HTTPS & TLS Break-and-Inspect on macOS: HTTP/2, QUIC & Per-Domain Bypass](<https://swgbar.com/en/guides/bypass-https-tls-inspection-mac/>)
*   [Why macOS Proxy Settings Fail Against Corporate Proxies (scutil & Per-Domain Fix)](<https://swgbar.com/en/guides/bypass-corporate-proxy-ssl-inspection-mac/>)
*   [How to Check if Your Mac Is Intercepted by an SWG (Zscaler, Netskope & 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/>)
*   [Can My Employer See My Browsing History, Incognito & Personal Accounts on a Work Mac?](<https://swgbar.com/en/guides/can-employer-see-browsing-history-incognito-work-mac/>)
*   [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/>)
*   [How to Turn Off or Bypass Zscaler on a Mac (When Tamper Protection Locks It)](<https://swgbar.com/en/guides/disable-turn-off-zscaler-on-mac/>)
*   [Cloudflare WARP & Zero Trust TLS Inspection on Mac: Detect & Bypass](<https://swgbar.com/en/guides/cloudflare-warp-tls-inspection-mac/>)
*   [Netskope SSL Inspection on Mac: Check Decryption & Bypass per Domain](<https://swgbar.com/en/guides/netskope-ssl-inspection-bypass-mac/>)
*   [Cisco Umbrella SSL Inspection on Mac: Check Decryption & Bypass per Domain](<https://swgbar.com/en/guides/cisco-umbrella-ssl-inspection-bypass-mac/>)
*   [Palo Alto GlobalProtect & Prisma Access SSL Decryption on Mac: Check & Bypass](<https://swgbar.com/en/guides/palo-alto-globalprotect-prisma-ssl-decryption-mac/>)
*   [Fortinet FortiClient & FortiGate (Fortinet\_CA\_SSL) Inspection on Mac: Check & Bypass](<https://swgbar.com/en/guides/fortinet-forticlient-ssl-inspection-bypass-mac/>)
*   [Fix Git & npm 'unable to get local issuer certificate' / SELF\_SIGNED\_CERT\_IN\_CHAIN on Mac](<https://swgbar.com/en/guides/fix-git-npm-unable-to-get-local-issuer-certificate-mac/>)
*   [Fix Python 'CERTIFICATE\_VERIFY\_FAILED' & Docker 'x509: certificate signed by unknown authority' on Mac](<https://swgbar.com/en/guides/fix-python-docker-certificate-verify-failed-x509-mac/>)
*   [Fix GitHub Copilot, OpenAI Codex & Gemini CLI SSL Certificate Errors on Mac (Zscaler / SWG)](<https://swgbar.com/en/guides/fix-codex-copilot-gemini-cli-ssl-certificate-error-mac/>)
*   [Fix Java, Maven, Gradle, IntelliJ & Android Studio 'PKIX path building failed' on Mac](<https://swgbar.com/en/guides/fix-java-maven-gradle-intellij-android-studio-pkix-mac/>)
*   [Fix AWS CLI & Boto3 'SSL validation failed' Certificate Errors on Mac](<https://swgbar.com/en/guides/fix-aws-cli-boto3-ssl-validation-failed-mac/>)
*   [Fix Google Cloud (gcloud) & Azure CLI (az login) SSL Certificate Errors on Mac](<https://swgbar.com/en/guides/fix-gcloud-azure-cli-ssl-certificate-verify-failed-mac/>)
*   [Fix Firefox 'SEC\_ERROR\_UNKNOWN\_ISSUER' Behind Zscaler & Corporate SWGs on Mac](<https://swgbar.com/en/guides/fix-firefox-sec-error-unknown-issuer-mac/>)
*   [Fix Ruby, Bundler & CocoaPods OpenSSL::SSL::SSLError on Mac](<https://swgbar.com/en/guides/fix-ruby-bundler-cocoapods-fastlane-ssl-error-mac/>)
*   [Fix Rust (cargo/rustup) & Go x509 SSL Errors on Mac](<https://swgbar.com/en/guides/fix-rust-cargo-rustup-go-ssl-x509-error-mac/>)
*   [Fix kubectl, Helm & Minikube x509 Unknown Authority on Mac](<https://swgbar.com/en/guides/fix-kubernetes-kubectl-helm-minikube-x509-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/>)
*   [Fix Claude Code & Cursor 'unable to get local issuer certificate' on Mac (SWG & MCP)](<https://swgbar.com/en/guides/ai-coding-agents-claude-code-cursor-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/>)
*   [SWG bar Pricing — One-Time License for macOS (Personal & Team)](<https://swgbar.com/en/pricing/>)
*   [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 Server — macOS TLS Certificate Monitoring & SWG Bypass for Claude Code and Cursor](<https://swgbar.com/en/mcp/>)
*   [SWG bar release information](<https://swgbar.com/en/releases/>)
*   [About SWG bar](<https://swgbar.com/en/about/>)
