Source: https://swgbar.com/en/guides/verify-tls-certificates-openssl-security-verify-cert-macos/
Language: en

# Verify TLS certificates with openssl & security verify-cert on Mac

Cross-check SWG bar's SHA-256 certificate fingerprints and trust verdicts on macOS using openssl s\_client, openssl x509, and macOS security verify-cert.

SWG bar · Updated November 18, 2026

While **SWG bar** summarizes certificate trust, issuers, and SHA-256 fingerprints right from the menu bar, security engineers and network admins often want to cross-check a suspicious domain independently using standard macOS and OpenSSL command-line tools.

## 1\. Record SWG bar’s probe evidence first

Before running raw CLI checks, inspect the target hostname in **SWG bar → Domains** (or via [CLI](<https://swgbar.com/en/cli/>)):

```
swgbar probe example.com --json
swgbar domains detail example.com --json
swgbar certificates detail "<certificate-name>" --json
```

Note three values for comparison: the **Issuer** / **Common name (CN)**, the **SHA-256 fingerprints**, and whether macOS trust differs from public CA validation (`Confirmed` or `Suspected`). See [Inspect MITM root certificates in SWG bar](<https://swgbar.com/en/guides/inspect-mitm-root-certificates-macos/>).

## 2\. Fetch the live TLS certificate chain with OpenSSL

Use `openssl s_client` to connect to port `443` with SNI (`-servername`) and inspect the certificate chain presented to your Terminal session:

```
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null
```

Save the first `-----BEGIN CERTIFICATE-----` block as `leaf.pem` and any intermediate block(s) as `intermediate.pem`, then inspect the leaf’s subject, issuer, validity dates, hostname match, and SHA-256 fingerprint:

```
openssl x509 -in leaf.pem -noout -subject -issuer -dates -fingerprint -sha256 -checkhost example.com
```

If the `Issuer` or `SHA-256 Fingerprint` differs from what you expect from the origin server (and matches the inspection root shown in SWG bar), the connection was terminated by an intermediary such as a corporate SWG.

## 3\. Cross-check macOS Keychain trust with security verify-cert

Next, verify how **macOS System Trust** evaluates that saved chain using Apple’s built-in `security verify-cert` utility:

```
security verify-cert -c leaf.pem -c intermediate.pem -p ssl -s example.com
```

*   When an MDM-installed SWG root CA is present in macOS Keychain, `security verify-cert` succeeds—matching SWG bar’s `macOS System Trust` pass—even though an unprivileged public root store (or a CLI runtime’s bundled CA file) rejects the chain.
*   Note that these commands inspect a connection and saved PEM blocks only; they do not install trust roots or modify system proxy settings.

## Account for differences between tools and browsers

If `openssl s_client` shows a different certificate from your browser, remember that applications may take different routes (for instance, explicit proxy settings, browser HTTP/3 vs. TCP, or tool-specific VPN exclusions), and SWG bar itself runs an independent IPv4 TCP probe rather than reading Chrome’s live socket. Always record the exact hostname, timestamp, network interface, and application tested—and review [Confirmed vs. Suspected HTTPS inspection](<https://swgbar.com/en/guides/confirmed-vs-suspected-https-inspection/>) to interpret results consistently.

## 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/>)
*   [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/>)
*   [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/>)
