SSL Inspection Explained: How It Works and How to Fix Certificate Errors

Your browser opens GitHub without any problem. Then you run pip install and get CERTIFICATE_VERIFY_FAILED. A Docker build stops halfway, and a desktop app stops connecting. Nothing is wrong with the internet. In most cases the cause is SSL inspection.

Security teams turn on SSL inspection so they can see inside encrypted traffic. Then developers and end users run into certificate errors that the browser never shows. Both sides are right, and both problems can be solved without switching security off.

In this guide, I explain how SSL inspection works step by step, why it breaks some applications, and how to fix each type of certificate error properly. I also walk through three real scenarios (Python, Docker and certificate-pinned apps) and finish with the troubleshooting order to follow when someone reports a certificate error behind Zscaler or a firewall.

Quick answer: What is SSL inspection? SSL inspection (also called TLS inspection or HTTPS inspection) lets a security proxy decrypt encrypted traffic, scan it for threats and data leaks, and re-encrypt it before sending it on. The proxy does this by presenting its own certificate, signed by a company root CA. Devices and applications that do not trust that root CA reject the connection, and that is where most certificate errors come from.

What Is SSL Inspection?

SSL inspection is a security control that restores visibility into encrypted web traffic. You will also see it called TLS inspection, TLS interception, HTTPS inspection or break and inspect. Strictly speaking, modern traffic uses TLS, not SSL, but “SSL inspection” is still the name most vendors and engineers use.

It matters because almost all web traffic is now encrypted. Encryption protects users, but it also hides malware downloads, command-and-control traffic and data exfiltration from the tools that are supposed to catch them. Without SSL inspection, these controls only see the destination, not the content:

  • Secure Web Gateways (SWG) such as Zscaler Internet Access (ZIA)
  • Next-Generation Firewalls (NGFW) that apply application and threat policies
  • Data Loss Prevention (DLP) engines that look for sensitive data in uploads
  • Sandboxes that detonate downloaded files to check their behaviour

Attackers know this. Hiding traffic inside normal-looking HTTPS is the same idea behind techniques like DNS tunneling: blend in with legitimate traffic so security tools do not look closely.

How SSL Inspection Works (Step by Step)

The key idea is simple: SSL inspection splits one TLS connection into two separate TLS sessions. The first session runs between your device and the security proxy. The second runs between the proxy and the real website. The proxy sits in the middle, so it can read the traffic before passing it on.

How SSL inspection works: the proxy creates two TLS sessions, a surrogate certificate for the device and a validated connection to the real website
SSL inspection splits one HTTPS connection into two separate TLS sessions.

1. Traffic reaches the proxy

An outbound HTTPS request is sent to the proxy in one of two ways:

  • Explicit forwarding: a PAC file or an endpoint agent, such as Zscaler Client Connector, sends traffic to the cloud proxy.
  • Transparent interception: an inline firewall at the network edge intercepts the traffic without any client configuration.

2. The proxy reads the SNI and checks exemptions

When the TLS connection starts, the client sends a ClientHello message. It normally includes the destination domain in clear text, in a field called Server Name Indication (SNI). The proxy reads the SNI and checks it against its SSL inspection policy. If the destination is on an exemption list (for example banking, healthcare or a certificate-pinned app), the proxy lets the traffic through without decrypting it.

Note: Encrypted Client Hello (ECH) hides the SNI from anything in the middle. Proxies that make decisions based on SNI lose that visibility, which is why many organisations control ECH on managed browsers.

3. The proxy connects to the real server and validates its certificate

If the traffic must be inspected, the proxy opens its own TLS session to the real destination. It now does the job your browser would normally do: it checks the server’s X.509 certificate for a matching hostname, a valid date range, a trusted issuer and revocation status (using CRL or OCSP). A good proxy blocks or warns on an invalid server certificate instead of hiding the problem from the user.

4. The proxy creates a surrogate certificate

The proxy now creates a new certificate for the same domain on the fly. This surrogate certificate is signed by the organisation’s own Certificate Authority (or the vendor’s intermediate CA, such as Zscaler’s). The proxy presents this certificate to your device instead of the real one.

Your device only accepts it if the matching root CA certificate is already installed in its trust store. This single requirement explains almost every SSL inspection error you will ever troubleshoot.

5. Decrypt, inspect and re-encrypt

With both sessions established, the proxy decrypts the HTTP traffic, scans it for malware and DLP violations, applies full URL-path policies (not just the domain), and re-encrypts it before forwarding. To the user, the page looks normal. The only visible sign is the certificate issuer.

How to check if your traffic is being inspected

Click the padlock in your browser and view the certificate. If the issuer is your company’s CA or Zscaler instead of a public CA, the site is being inspected. From a terminal, you can check the same thing:

openssl s_client -connect pypi.org:443 -servername pypi.org </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer

If the issuer line shows your proxy’s CA, inspection is active for that site. This one command saves a lot of guessing during troubleshooting.

Why SSL Inspection Causes Certificate Errors

After SSL inspection is enabled, these are the errors you will see most often:

NET::ERR_CERT_AUTHORITY_INVALID
[SSL: CERTIFICATE_VERIFY_FAILED] unable to get local issuer certificate
x509: certificate signed by unknown authority
PKIX path building failed: unable to find valid certification path to requested target
self signed certificate in certificate chain

They look different, but they come from three root causes.

Cause 1: The application uses its own trust store

Browsers like Chrome, Edge and Safari use the operating system’s certificate store (Windows Certificate Store, macOS Keychain or /etc/ssl/certs on Linux). When IT installs the corporate root CA there, the browser works.

Many developer tools do not use the OS store at all. They ship with their own list of trusted root CAs:

  • Python (requests uses the certifi bundle)
  • Node.js and npm (bundled Mozilla root CAs)
  • Java (the cacerts keystore)
  • Git, curl, AWS CLI and container images, depending on how they were built

These tools have never heard of your corporate root CA, so they reject the surrogate certificate that SSL inspection presents. This is the most common reason the browser works while the terminal fails.

Why SSL inspection breaks developer tools: browsers use the OS trust store while Python, Node.js, Java, Git and Docker use their own
Why SSL inspection breaks developer tools but not browsers.

Cause 2: Certificate pinning

Some applications hardcode the certificate or public key they expect from their backend server. This is called certificate pinning. When the proxy replaces the real certificate with a surrogate, the app sees a mismatch and drops the connection, even if the corporate root CA is installed and trusted.

There is no standard way pinned apps fail. Zscaler’s documentation on certificate pinning and SSL inspection notes that some clients finish the handshake and then close the connection, while others simply reset it. In logs from the client side, you may see an OpenSSL error such as error:0A000412 ... sslv3 alert bad certificate, which means the client sent a TLS “bad certificate” alert.

Installing certificates cannot fix pinning. The only fix is to stop inspecting that destination.

Certificate pinning vs SSL inspection: a pinned app rejects the proxy certificate and a narrow Do Not Inspect rule fixes it
Certificate pinning blocks SSL inspection; a narrow Do Not Inspect rule fixes it.

Cause 3: Stricter validation and incomplete chains

Some runtimes check certificates more strictly than browsers. A good example is Python 3.13, which turns on the VERIFY_X509_STRICT flag by default in ssl.create_default_context(). A corporate or proxy CA that was created without required X.509 extensions (for example a Basic Constraints extension not marked critical, or a missing Authority Key Identifier) can fail with errors like:

certificate verify failed: Basic Constraints of CA cert not marked critical

Errors also appear when a trust bundle contains the root CA but not a required intermediate certificate. The proper fix is for the PKI team to reissue the CA correctly or ship the full chain. As a temporary, narrow workaround in your own code, Python’s documentation shows how to remove only the strict flag while keeping full verification:

import ssl
ctx = ssl.create_default_context(cafile="/opt/proxy/combined_bundle.pem")
ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT  # temporary, until the CA is reissued

How to Fix SSL Inspection Certificate Errors

Fix SSL inspection certificate errors in layers: first the operating system, then each tool that keeps its own trust store, and finally any pinned application.

3 proven fixes for SSL inspection certificate errors: OS trust store, developer tool trust stores and Do Not Inspect rules for pinned apps
The 3 proven fixes for SSL inspection certificate errors, applied in layers.

Step 1: Install the root CA in the operating system trust store

PlatformWhere trust livesCommand or method
WindowsLocal Machine certificate storecertutil -addstore -f Root corporate-root.crt (run as administrator), or deploy with Group Policy or Intune
macOSSystem Keychainsudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain corporate-root.crt, or deploy with an MDM profile
Ubuntu / Debian/etc/ssl/certs/Copy the .crt file to /usr/local/share/ca-certificates/, then run sudo update-ca-certificates
RHEL / CentOS / Fedora/etc/pki/ca-trust/Copy the file to /etc/pki/ca-trust/source/anchors/, then run sudo update-ca-trust extract
FirefoxOwn certificate database (NSS)Since Firefox 120, certificates added to the OS store are trusted by default on Windows and macOS. To enforce it, deploy policies.json with "ImportEnterpriseRoots": true

Zscaler tip: Zscaler Client Connector can install the Zscaler (or your custom) SSL certificate automatically through the Install Zscaler SSL Certificate option in the app profile. Zscaler documents that this option is not supported on macOS Big Sur (11) and later, so deploy the certificate with your MDM on modern Macs. If you are preparing for an interview, this is a common question in Zscaler Client Connector interview questions.

Step 2: Point developer tools at a combined CA bundle

For tools with their own trust store, build one combined bundle that contains the public root CAs plus your corporate root CA:

# 1. Export the corporate root CA in PEM (Base-64) format, e.g. /opt/proxy/corp-root.pem
# 2. Combine it with the public roots from certifi into a new file
cat "$(python3 -m certifi)" /opt/proxy/corp-root.pem > /opt/proxy/combined_bundle.pem

Then point each tool at it. Pay attention to the last column: most settings replace the default trust list instead of adding to it.

ToolSettingReplaces or adds?
Python requestsexport REQUESTS_CA_BUNDLE=/opt/proxy/combined_bundle.pemReplaces
OpenSSL-based tools (Python ssl, Ruby and others)export SSL_CERT_FILE=/opt/proxy/combined_bundle.pemReplaces
pipexport PIP_CERT=/opt/proxy/combined_bundle.pemReplaces
Node.js / npmexport NODE_EXTRA_CA_CERTS=/opt/proxy/corp-root.pemAdds
npm (config)npm config set cafile /opt/proxy/combined_bundle.pemReplaces
Gitgit config --global http.sslCAInfo /opt/proxy/combined_bundle.pemReplaces
curlexport CURL_CA_BUNDLE=/opt/proxy/combined_bundle.pemReplaces
AWS CLIexport AWS_CA_BUNDLE=/opt/proxy/combined_bundle.pemReplaces
Java (JDK 9+)keytool -importcert -trustcacerts -cacerts -storepass changeit -noprompt -alias corporate-ca -file corp-root.pemAdds

On Windows, set the same variables with setx, for example setx REQUESTS_CA_BUNDLE C:\certs\combined_bundle.pem. For Java 8, use -keystore "$JAVA_HOME/jre/lib/security/cacerts" instead of -cacerts. Zscaler keeps a longer list of tools in its guide to adding a custom certificate to an application-specific trust store.

Always combine bundles. If REQUESTS_CA_BUNDLE points only at the corporate root CA, every site that bypasses inspection will fail, because the public roots are gone. Build a separate combined file instead of editing certifi’s own cacert.pem, which is overwritten whenever certifi is upgraded.

Step 3: Use the system trust store where the tool supports it

Manual bundles work, but they need maintenance every time the SSL inspection CA or a runtime changes. Newer tool versions can read the OS store directly, so the certificate IT already deployed just works:

  • pip 24.2 and later on Python 3.10+ uses system certificates in addition to certifi by default, as described in the pip HTTPS certificates documentation. Upgrading pip often fixes pip install errors on its own.
  • Python scripts can use the truststore package (Python 3.10+): call truststore.inject_into_ssl() at startup, and requests, urllib3 and similar libraries will use the OS store.
  • Node.js (v22.15.0, v23.9.0, v24.0.0 and later) supports --use-system-ca or NODE_USE_SYSTEM_CA=1, which loads system CAs in addition to the bundled ones. See the Node.js guide to enterprise network configuration.
  • Git for Windows can use the Windows certificate store with git config --global http.sslBackend schannel.

Never disable verification. Settings like verify=False, NODE_TLS_REJECT_UNAUTHORIZED=0 or GIT_SSL_NO_VERIFY=true make the error disappear by turning off TLS validation completely. That leaves the system open to on-path attacks, the same risk covered in our guide to ARP spoofing and MITM attacks. They have no place in enterprise scripts or pipelines.

Real-World SSL Inspection Scenarios

Scenario 1: pip and Python scripts fail, but the browser works

The problem: A development team behind ZIA or another SWG can open GitHub and PyPI in the browser. But pip install -r requirements.txt and their automation scripts fail with:

requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate

Root cause: IT pushed the corporate root CA to the Windows or macOS trust store, which the browser uses. The requests library (and pip older than 24.2) relies on certifi, which knows nothing about the OS store.

Fix:

  1. Upgrade pip: python -m pip install --upgrade pip. On Python 3.10+ this alone usually fixes pip install.
  2. For scripts using requests, either add truststore.inject_into_ssl() or build the combined bundle shown above.
  3. If you use a bundle, deploy the variables to every developer machine through MDM (Intune or Jamf) in the shell profile:
export REQUESTS_CA_BUNDLE=/opt/proxy/combined_bundle.pem
export SSL_CERT_FILE=/opt/proxy/combined_bundle.pem
export PIP_CERT=/opt/proxy/combined_bundle.pem

Remember that CI/CD runners behind the same SSL inspection proxy need the same fix. A pipeline that works on a laptop can still fail on a build agent.

Scenario 2: Docker builds and Java services fail inside containers

The problem: A DevOps team builds images on an internal server. A RUN step that downloads something over HTTPS (curl, pip, npm or Git) fails with a certificate error, and a Java microservice in the container crashes at startup with:

sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target

Root cause: Containers do not inherit the host’s trust store, so SSL inspection breaks them by default. A minimal base image ships with public root CAs at most, and some (like debian:bookworm) do not even include the ca-certificates package. The JVM also checks its own cacerts keystore, not the Linux store.

Fix: Add the corporate root CA to the image at build time, following the same approach as Docker’s official guide to using Docker with Zscaler:

# Debian-based image: add the CA to the Linux trust store
FROM debian:bookworm
COPY corp-root.crt /usr/local/share/ca-certificates/corp-root.crt
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
    && update-ca-certificates
# Java image: also import the CA into the JVM truststore
FROM eclipse-temurin:21-jre
COPY corp-root.crt /tmp/corp-root.crt
RUN keytool -importcert -trustcacerts -cacerts -storepass changeit \
    -noprompt -alias corporate-ca -file /tmp/corp-root.crt

If docker pull itself fails with x509: certificate signed by unknown authority, the problem is on the host: add the root CA to the host’s trust store and restart Docker.

Scenario 3: Pinned applications stop working after SSL inspection is enabled

The problem: After full SSL inspection is rolled out, some apps hang or show connection errors, even though the root CA is installed. Apple services are a well-known case: Apple’s guide to using Apple products on enterprise networks states that its services fail connections that use HTTPS interception. In a packet capture, the TCP connection opens, the proxy sends its certificate, and the client immediately closes or resets the connection without sending any application data.

Root cause: The app uses certificate pinning. A surrogate certificate can never match the pinned key, so no client-side certificate change will help.

Fix (Zscaler example):

  1. Find the failing destinations. In ZIA Web Insights (or your firewall’s logs), filter for the user and time of the failure and note the FQDNs with failed handshakes.
  2. Check the predefined exemption rule. ZIA includes a Zscaler Recommended Exemptions rule, enabled by default, that skips inspection for known destinations that cannot be inspected, such as pinned apps. Make sure nobody disabled it or placed a broad Inspect rule above it.
  3. Create a narrow Do Not Inspect rule. Add the specific FQDNs to a custom URL category and create an SSL Inspection rule with the Do Not Inspect action. Place it above your general Inspect rule, because rules are evaluated top-down and the first match wins.
  4. Keep other controls in place. Bypassing decryption does not mean bypassing security. Domain-based controls such as URL filtering still apply using the SNI. Record each bypass with a business owner and a review date so the list does not grow forever.

For more on how ZIA handles SSL policies, see our ZIA interview questions and answers.

SSL Inspection Troubleshooting Checklist

When someone reports a certificate error behind SSL inspection, work through these questions in order:

  1. Who issued the certificate? Use the padlock or the openssl s_client command. If the issuer is a public CA, the site is not being inspected and the problem is elsewhere.
  2. Does the same site work in the browser? If yes, the OS trusts the root CA and the failing tool uses its own trust store.
  3. Is the root CA in the OS store at all? If the browser also fails, fix the OS trust store first (Step 1).
  4. Which runtime is failing? Point it at the combined bundle or switch on its system-store option (Steps 2 and 3).
  5. Still failing with the correct bundle? Look for strict-validation errors or a missing intermediate certificate (Cause 3).
  6. Does the client drop the connection right after receiving the certificate? Suspect certificate pinning and create a narrow Do Not Inspect rule.
  7. Did someone suggest verify=False? Say no and fix the trust store instead.

If the TLS handshake never starts at all, the issue is lower in the stack. Our 3-way handshake troubleshooting guide covers that layer.

SSL inspection certificate error troubleshooting flowchart
SSL inspection troubleshooting flowchart: follow the questions from top to bottom.

SSL Inspection Best Practices for Security Teams

  • Deploy the root CA before you enable inspection. Push it with MDM or Group Policy, confirm it on a pilot group, and only then turn on inspection for that group.
  • Roll out in phases. Start with high-risk categories and expand. A big-bang rollout produces a flood of tickets.
  • Exempt by privacy and compatibility, not convenience. Banking, healthcare and pinned apps are valid exemptions. “A developer was annoyed” is not.
  • Give developers a supported fix. Publish the combined bundle and the environment variables centrally, so nobody reaches for verify=False.
  • Protect the CA. The inspection CA can sign a certificate for any site your devices trust. Treat its private key as a crown-jewel secret.

SSL inspection is one layer of a wider Zero Trust architecture: it lets you verify what is inside traffic, not just where it is going.

Frequently Asked Questions About SSL Inspection

Is SSL inspection the same as a man-in-the-middle attack?

Technically, it uses the same position in the middle of the connection. The difference is authorisation: the organisation owns the devices, installs its own root CA on purpose and applies a written policy. An attacker does none of these, which is why browsers warn users when an unknown CA appears.

Can SSL inspection see my passwords?

For inspected sites, yes, the proxy sees the decrypted traffic. That is why organisations usually exempt categories like banking and healthcare, and why access to inspection logs should be tightly controlled.

Does SSL inspection work with TLS 1.3?

Yes. TLS 1.3 prevents passive decryption, but SSL inspection is an active proxy that terminates the connection and opens a new one, so it still works. Encrypted Client Hello is a bigger challenge, because it hides the SNI that many exemption decisions depend on.

Why does my browser work but Python or Git fails?

The browser trusts the operating system’s certificate store, where IT installed the corporate root CA. Python, Git, Node.js and Java often use their own trust stores, so they need the root CA added separately or a system-store option turned on.

Can I fix certificate pinning errors by installing the root CA?

No. A pinned app only accepts its own expected certificate or key, so a surrogate certificate fails even when your root CA is trusted. The fix is a narrow Do Not Inspect rule for that destination.

Conclusion: SSL Inspection Without the Certificate Headaches

SSL inspection gives security teams back the visibility that encryption takes away. Almost every certificate error it causes comes down to one question: does this application trust the CA that signed the surrogate certificate? Fix trust in the OS, give developer tools a combined bundle or a system-store option, and exempt pinned apps narrowly. You can keep inspection on and keep developers productive.

Want to go further? Read our NGFW guide to see where inspection fits in a firewall, or test yourself with our network security interview questions.

Which certificate error has taken you the longest to fix? Share it in the comments below.

Leave a Comment