Source: https://swgbar.com/en/guides/fix-aws-cli-boto3-ssl-validation-failed-mac/
Language: en

# Fix AWS CLI & Boto3 'SSL validation failed' Certificate Errors on Mac

Fix AWS CLI v2, Boto3, AWS SAM, and CDK SSL validation failed / CERTIFICATE\_VERIFY\_FAILED errors behind Zscaler, Cloudflare WARP, or Netskope on macOS—filling the macOS gap in official SWG docs.

SWG bar · Updated November 24, 2026

When running `aws s3 ls`, `aws sts get-caller-identity`, `aws sso login`, or Python **Boto3** scripts on a corporate Mac behind Zscaler, Cloudflare WARP, Netskope, Cisco Umbrella, or Palo Alto GlobalProtect, you will often hit:

```
SSL validation failed for https://sts.us-east-1.amazonaws.com/
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
unable to get local issuer certificate (_ssl.c:1006)
```

Official SWG help docs frequently document only Windows or Ubuntu paths for AWS CLI and Boto3. Even worse, setting `AWS_CA_BUNDLE` to _only_ your corporate SWG root certificate causes another trap: **AWS CLI v2 and `botocore` replace their entire default truststore when `AWS_CA_BUNDLE` is set**, so any non-intercepted AWS endpoint immediately breaks. Paste your error into our free [SWG & SSL Error Decoder](<https://swgbar.com/en/tools/tls-error-decoder/>) or follow the upgrade-safe macOS fix below.

## 1\. Build a combined macOS + corporate SWG CA bundle

Instead of overwriting Homebrew’s or `/usr/local/aws-cli`’s internal `cacert.pem` (which gets wiped on every upgrade), build a single combined PEM file in `~/.certs/aws-combined-ca.pem` that contains **all macOS system 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/aws-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/aws-combined-ca.pem"
```

Because both standard public roots (including Amazon Root CA 1–4) and your corporate SWG CA are inside one bundle, **both inspected and non-inspected AWS endpoints validate cleanly**.

## 2\. Configure AWS CLI v2 persistently on macOS

Set the `ca_bundle` option in `~/.aws/config` so every terminal session, IDE task, and script picks it up automatically:

```
aws configure set default.ca_bundle "$HOME/.certs/aws-combined-ca.pem"
```

If you use multiple named AWS profiles (`--profile prod`), also export `AWS_CA_BUNDLE` in `~/.zshrc` so every profile inherits it automatically:

```
echo 'export AWS_CA_BUNDLE="$HOME/.certs/aws-combined-ca.pem"' >> ~/.zshrc
source ~/.zshrc
```

Verify without ever using `--no-verify-ssl`:

```
aws sts get-caller-identity
```

## 3\. Fix Python Boto3, AWS SAM CLI & AWS CDK on macOS

Different AWS tools use different runtimes underneath:

*   **Python `boto3` & `botocore`**: Automatically respect `AWS_CA_BUNDLE` (as well as `REQUESTS_CA_BUNDLE`). For scripts that also call non-AWS HTTPS APIs via `requests`, add to `~/.zshrc`:
    
    ```
    export AWS_CA_BUNDLE="$HOME/.certs/aws-combined-ca.pem"
    export REQUESTS_CA_BUNDLE="$HOME/.certs/aws-combined-ca.pem"
    export SSL_CERT_FILE="$HOME/.certs/aws-combined-ca.pem"
    ```
    
*   **AWS SAM CLI (`sam build` / `sam deploy`)**: Respects `AWS_CA_BUNDLE`. If `sam build --use-container` fails inside Docker, also follow our [Docker Desktop x509 certificate fix for Mac](<https://swgbar.com/en/guides/fix-python-docker-certificate-verify-failed-x509-mac/>).
*   **AWS CDK (`cdk synth` / `cdk deploy`)**: Runs on Node.js, which ignores `AWS_CA_BUNDLE` and requires `NODE_EXTRA_CA_CERTS` pointing to your corporate SWG root PEM:
    
    ```
    security find-certificate -c "Zscaler" -p /Library/Keychains/System.keychain > "$HOME/.certs/corporate-swg-root.pem"
    echo 'export NODE_EXTRA_CA_CERTS="$HOME/.certs/corporate-swg-root.pem"' >> ~/.zshrc
    source ~/.zshrc
    ```
    

## 4\. Skip CA bundle maintenance with per-domain SWG bypass

If your organization allows per-domain SWG bypass for cloud control-plane APIs, [SWG bar](<https://swgbar.com/en/install/>) confirms which AWS endpoints are being decrypted and restores the authentic Amazon TLS certificate per hostname in one click—keeping your corporate VPN and SSO untouched:

```
swgbar probe sts.amazonaws.com
swgbar bypass enable sts.amazonaws.com
swgbar bypass enable s3.amazonaws.com
```

Also using GCP or Azure on the same Mac? Read [Fix Google Cloud (`gcloud`) & Azure CLI (`az login`) SSL errors on Mac](<https://swgbar.com/en/guides/fix-gcloud-azure-cli-ssl-certificate-verify-failed-mac/>), [Fix Python & Docker SSL errors on Mac](<https://swgbar.com/en/guides/fix-python-docker-certificate-verify-failed-x509-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.12/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 (Zscaler, Cloudflare, Netskope — 1-Click & 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 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 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/>)
*   [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/>)
*   [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/>)
