When a corporate proxy inspects TLS, npm, pip, git, Node.js and Docker start failing with certificate errors, and the safe fix is always to teach each tool to trust the inspection CA rather than to switch verification off. The errors look alarming (self-signed certificate in certificate chain, unable to get local issuer certificate, x509: certificate signed by unknown authority) but the cause is usually simple: the proxy re-signs every HTTPS connection with an internal certificate authority, the operating system trusts that CA because IT pushed it there, and the developer tool ships or reads a different trust store that does not.
The shortcut people reach for under deadline pressure is to disable verification: strict-ssl=false, NODE_TLS_REJECT_UNAUTHORIZED=0, a trusted host flag, or a per-host sslVerify override. Each one turns a trust problem into a silent interception risk, and the setting tends to outlive the laptop it was set on, ending up in shared dotfiles, container images and CI runners where it exposes registry tokens, deploy keys and package integrity to anyone on the path. This guide covers diagnosing the failure, distributing the CA bundle, the per-tool settings that add trust safely, CI and containers, and how to find and remove verification overrides that have already spread. For the network-side design of inspection itself (what to inspect, exemptions, protecting the interception CA), see our TLS Inspection Guide; this page does not repeat it.
Key takeaways
- The root cause is a trust store mismatch: the proxy CA is in the operating system store but the tool uses its own bundle or a language runtime bundle.
- The fix is additive trust: append the inspection CA to what the tool already trusts. Never replace the public root set and never disable verification.
- npm (
cafile), pip (--cert,PIP_CERT, or system certificates through truststore), Node.js (NODE_EXTRA_CA_CERTSor--use-system-ca), git (per-URL http settings) and Docker (certs.d) all have a supported way to add a CA. - Verification overrides are credentials risks, not just hygiene issues: registry tokens, git credentials and cloud keys cross those connections.
- Publish one signed, versioned CA bundle from a known internal location and make every workstation, image and runner consume it.
- Hunt for and remove existing overrides in dotfiles, Dockerfiles, CI variables and repository configs, and block them from coming back with pre-commit and pipeline checks.
Why tools break behind TLS inspection
A TLS-inspecting proxy terminates the client connection, opens its own connection to the real server, and presents the client with a certificate for the destination hostname that it signed with its own CA. Browsers on managed devices accept this because endpoint management installs the proxy CA into the operating system trust store, which browsers consult. Developer tools are different. Many runtimes and package managers carry a bundled list of public roots, or read a language-specific bundle, so they never see the CA that IT installed. The connection then fails exactly as it should when someone intercepts traffic: the tool cannot build a chain to a root it trusts.
That is the important framing. The tool is behaving correctly. A certificate error behind an inspecting proxy is the same signal it would raise during a real adversary-in-the-middle attack (MITRE ATT&CK T1557 Adversary-in-the-Middle). Turning verification off means the tool will also accept the next interception, including one that is not your proxy: a hostile hotspot, a compromised home router, or a rogue device on a guest network when the laptop is off the corporate path.
Typical symptoms and where they come from:
| Tool | Typical error text | Usual cause |
|---|---|---|
| npm | SELF_SIGNED_CERT_IN_CHAIN, UNABLE_TO_GET_ISSUER_CERT_LOCALLY | Node.js bundled roots do not include the proxy CA |
| pip | SSL: CERTIFICATE_VERIFY_FAILED | Older pip versions use only the bundled certifi roots |
| git over HTTPS | SSL certificate problem: unable to get local issuer certificate | The TLS backend git was built with uses a bundle without the proxy CA |
| Node.js applications and CLIs | Same codes as npm | Bundled roots only, unless told otherwise |
| Docker pull and push | x509: certificate signed by unknown authority | Daemon or VM trust store lacks the proxy CA |
| Containers at build or run time | Any of the above inside the image | Base image trust store has never seen the proxy CA |
Diagnose before you change anything
Confirm that inspection is really the cause before touching configuration. A broken chain on the server side, an expired certificate or a clock skew can produce the same errors. Three quick checks settle it.
- Look at the issuer. Run
openssl s_client -connect registry.npmjs.org:443 -servername registry.npmjs.org -showcertsthrough the proxy (or with proxy environment variables set) and read the issuer of the leaf certificate. If it names your organisation or your proxy product rather than a public CA, the proxy is re-signing. - Compare with a path that is not inspected. If the same command from a network that bypasses the proxy shows a public issuer, inspection is confirmed.
- Check the proxy CA is genuine. Get the fingerprint of the inspection root from your network or PKI team through a trusted channel and compare it with what the proxy presents. Never trust a CA simply because it appeared in the chain; that is exactly how an attacker would want you to fix the error.
Record which tools fail and which trust store each one uses. That list becomes your rollout plan.
Build and distribute one trusted CA bundle
Most of the pain comes from every developer exporting the proxy certificate their own way, from a browser padlock dialog, into a file in their home directory. Replace that with a single, owned artefact.
- One owner. The PKI or network team owns the inspection CA and publishes its public certificate (and any intermediates the proxy chains to) in PEM format. Only the public certificate is ever distributed; the CA private key never leaves the proxy or its HSM.
- One location. Serve the bundle from an internal HTTPS location and from endpoint management, with a published SHA-256 fingerprint. Workstations get it installed in the operating system store and as a PEM file at a fixed path that tools can be pointed at.
- Additive, not replacement. Where a tool needs a file, the file should contain the proxy CA. Some tools add that file to their built-in roots; others replace their roots with the file. For the replacing tools, build a combined bundle (public roots plus proxy CA) so that connections that are exempt from inspection still validate.
- Versioned and rotated. The inspection CA will be renewed. Version the bundle, publish both old and new CA during a changeover, and announce the date the old one is removed.
Treat the bundle as security configuration. A tampered bundle that adds an extra root is an interception backdoor for every tool that reads it, so protect the publishing location and check the fingerprint in automation that fetches it.
npm and Node.js
npm exposes three relevant settings. According to the npm configuration documentation, cafile is "a path to a file containing one or multiple Certificate Authority signing certificates", ca is "the Certificate Authority signing certificate that is trusted for SSL connections to the registry", and strict-ssl controls "whether or not to do SSL key validation when making requests to the registry via https", with a default of true.
- Set
cafileto the organisation bundle path in the user or global.npmrc, managed centrally where possible. Because thecafamily of settings defines what npm trusts for registry connections, point it at a combined bundle if you also reach registries that are exempt from inspection. - Leave
strict-sslat its default of true. Astrict-ssl=falseline anywhere is a finding. - Proxy routing uses
proxy,https-proxyandnoproxy; npm also honours the standard proxy environment variables. Routing and trust are separate problems: fixing one does not fix the other.
For Node.js applications and Node-based CLIs, the Node.js command-line documentation gives two supported options:
NODE_EXTRA_CA_CERTS=fileextends the well known root CAs with the extra certificates in a PEM file. The documentation notes the variable is only read when the process is first launched, that it is ignored when node runs as setuid root or has Linux file capabilities set, and that neither the well known nor extra certificates are used when a TLS client explicitly sets its owncaoption. That last point explains why some libraries still fail after the variable is set.--use-system-ca(added in v23.8.0, with support beyond Windows and macOS from v23.9.0) makes Node.js use trusted CA certificates from the system store. On Windows and macOS it reads the platform stores; on other systems it loads the default certificate file and directory that the linked OpenSSL respects. ANODE_USE_SYSTEM_CA=1environment variable is also documented (added in v24.6.0 and v22.19.0). Where the proxy CA is already in the operating system store, this removes the need to manage a separate file.
The same documentation is blunt about the shortcut: if NODE_TLS_REJECT_UNAUTHORIZED equals 0, "certificate validation is disabled for TLS connections. This makes TLS, and HTTPS by extension, insecure. The use of this environment variable is strongly discouraged." Treat it as forbidden in shells, images and pipelines. For wider npm hygiene, see the npm Tokens Security Guide, because the token in .npmrc is exactly what crosses these connections.
pip and Python
The pip HTTPS certificates documentation explains that pip verifies certificates for HTTPS connections to protect downloads against man-in-the-middle attacks, and describes the supported ways to change what it trusts:
- System certificates. pip uses system certificates alongside its bundled certifi roots through the truststore package. The page states that versions of pip prior to v24.2 did not use system certificates by default, so on current pip a proxy CA in the operating system store is often enough on its own. Upgrading pip is frequently the cleanest fix.
- An explicit bundle. The
--certoption, or thePIP_CERTenvironment variable, points pip at a different certificate bundle. Because this replaces what pip trusts for that run, use a combined bundle. - Requests-style variables. The documentation also lists
REQUESTS_CA_BUNDLEandCURL_CA_BUNDLEas ways to specify a bundle.
The common unsafe workaround in Python teams is to mark package indexes as trusted hosts so pip stops checking them. That means anyone on the path can serve a modified package, which is a direct software supply chain exposure. Use the certificate settings instead and remove trusted host entries from pip.conf, requirements files and CI scripts. Our Python Packaging and pip Security Guide covers the rest of the install path, including hash checking, which gives a second layer of protection even when transport is intercepted.
Python applications that make their own HTTPS calls have the same problem as pip. Prefer libraries and settings that use the operating system store, or pass the combined bundle explicitly. Never ship code that sets verification to false, even behind a debug flag.
git over HTTPS
git reads its HTTP settings from the configuration system documented in git-config, which supports URL-scoped sections: a value under http."https://host.example.com" applies only to that URL, with the generic http section as fallback, and git config get --url=<URL> http.sslVerify shows the effective value for a given URL. That scoping is useful in both directions.
- Safe use. Point git at the organisation CA bundle using the certificate authority settings in the
httpsection described in git-config, scoped to the hosts that are inspected if you want to limit the change. On platforms where git uses the operating system TLS stack, a CA in the system store may already be enough; check which backend your build uses before adding files. - Unsafe use. The same scoping is how per-host
sslVerify = falseoverrides get created. git-config's own example shows a host-specificsslVerify = falseblock. Those lines are easy to miss because they sit beside legitimate settings, so search for them explicitly.
git connections carry personal access tokens and credential helper secrets on every fetch and push. An unverified connection lets an interceptor capture them, so this override has a direct non-human identity impact. Prefer SSH or short-lived tokens where possible, and see the Git Repository Security Guide for credential handling.
Docker and container images
Docker has two separate trust problems: the daemon talking to registries, and software inside images talking to the internet at build and run time.
For the daemon, the Docker certificate documentation describes per-registry CA directories. On native Linux Engine they live under /etc/docker/certs.d/; rootless Linux uses $XDG_CONFIG_HOME/docker/certs.d (by default ~/.config/docker/certs.d); native Windows Engine uses %PROGRAMDATA%\docker\certs.d; and Docker Desktop with Linux containers reads ~/.docker/certs.d on the host and copies it into its VM, so you should not configure the path inside the VM. Each registry gets a subdirectory named after its hostname (with the port if one is used), every *.crt file in it is treated as a CA root, and a CA saved with a .cert extension is read as a client certificate and triggers a "Missing key" error. On Linux, custom roots are merged with the system defaults; on Windows Server, or Docker Desktop with Windows containers, system default certificates are used only when no custom roots are configured, which is a reason to keep Windows bundles complete.
Inside images, the base image trust store knows nothing about your proxy. The safe patterns are:
- Use an internal base image that already includes the organisation CA in the distribution trust store, built and signed by the platform team.
- Where the CA is only needed at build time, mount it as a build secret or a temporary file for the steps that fetch dependencies, rather than baking it into the final image that ships to environments without inspection.
- Never add verification-disabling environment variables or flags to Dockerfiles. They persist in image layers and history and travel with the image wherever it runs.
Our Docker Desktop Security guide covers the rest of the workstation side.
CI runners, build agents and service accounts
Pipelines are where verification overrides do the most damage, because runners hold the most powerful credentials in the estate: registry publish tokens, cloud deployment identities, signing keys and package feed credentials. A runner that ignores certificate errors will hand those to an interceptor without a trace.
- Bake the organisation bundle into runner images, or install it at runner provisioning, and set tool configuration (npm
cafile, Node.js system CA use, pip certificate settings, git CA settings) in the image rather than in individual pipeline files. - Hosted runners that do not pass through your proxy do not need the proxy CA at all. Do not copy inspection settings to them out of habit; a bundle that replaces public roots can break them, and a disabled-verification flag protects nothing.
- Scan pipeline definitions and CI variables for override flags and variables on every change, and fail the pipeline when one appears.
- Consider whether build traffic to package registries needs inspection at all. Many organisations route it through an internal package proxy or artefact repository instead, which reduces the number of tools that must trust the inspection CA and gives a single place to verify packages.
Finding and removing verification overrides
Assume overrides already exist. Search for them across the places they hide, then remove them in the same change that adds the correct CA setting, so nobody is left broken.
| Where | What to search for |
|---|---|
User and project .npmrc | strict-ssl=false, unexpected ca values |
| Shell profiles, CI variables, Dockerfiles, compose files | NODE_TLS_REJECT_UNAUTHORIZED set to 0 |
pip.conf, requirements files, CI scripts | Trusted host entries and flags |
| Global and repository git config | sslVerify set to false, globally or under a URL-scoped section |
| Application code | HTTP clients created with verification disabled |
| Docker daemon configuration | Registries configured to skip TLS rather than trusting a CA |
Add these patterns to pre-commit hooks and repository scanning so they are caught before merge (see the Git Hooks and Pre-commit Security Guide). Where an override was in place on a machine or runner that held credentials, treat the credentials that crossed those connections as potentially exposed if the machine was used off the corporate network, and rotate the high-value ones.
Common failure patterns
- Disabling verification "temporarily". The flag outlives the incident and spreads through copied dotfiles and templates.
- Replacing public roots with the proxy CA. Tools that load only the proxy CA then fail for exempt destinations, which prompts the next round of overrides.
- Exporting the CA from a browser dialog. Developers capture an intermediate, a leaf or a stale CA, and nobody can tell which file is authoritative.
- Trusting whatever appears in the chain. Adding a CA without checking its fingerprint against an authoritative source is indistinguishable from accepting an attacker's certificate.
- Baking the CA and overrides into shipped images. Images built behind the proxy carry settings into production environments that never needed them.
- Forgetting rotation. When the inspection CA is renewed, every hand-managed copy breaks at once and the overrides come back.
- Library-level ca options. A client that sets its own
caignores Node.js extra and default certificates, so environment fixes appear not to work.
Practitioner checklist
- Confirm inspection is the cause by checking the issuer and comparing against an uninspected path.
- Publish one PEM bundle of the inspection CA with a fingerprint, an owner, a version and a rotation plan.
- Install the CA in operating system stores through endpoint management, and provide a combined bundle file at a fixed path.
- Configure npm
cafile, Node.jsNODE_EXTRA_CA_CERTSor system CA use, pip certificate settings, git CA settings and Dockercerts.dcentrally. - Keep npm
strict-ssltrue and banNODE_TLS_REJECT_UNAUTHORIZED=0, pip trusted hosts and gitsslVerify=false. - Build internal base images and runner images that already trust the bundle; mount the CA only at build time where final images do not need it.
- Scan dotfiles, repositories, Dockerfiles and CI variables for overrides and block them in pre-commit and pipeline checks.
- Rotate registry tokens, git credentials and deployment secrets that crossed unverified connections off the corporate network.
- Rehearse a CA rotation with both old and new roots published before the old one is removed.
Standards and references
- npm Docs: config (ca, cafile, strict-ssl, proxy settings)
- Node.js: Command-line API (NODE_EXTRA_CA_CERTS, --use-system-ca, NODE_TLS_REJECT_UNAUTHORIZED)
- pip: HTTPS Certificates
- git: git-config documentation
- Docker Docs: Verify repository client with certificates
- MITRE ATT&CK: Adversary-in-the-Middle
- NIST: SP 800-52 Rev. 2, Guidelines for the Selection, Configuration, and Use of TLS Implementations
- NIST: SP 800-53 Rev. 5 (SC-8 Transmission Confidentiality and Integrity, SC-17 Public Key Infrastructure Certificates, CM-6 Configuration Settings)
Related NHI Mgmt Group resources: TLS Inspection Guide · Certificate Pinning · npm Tokens Security Guide · Python Packaging and pip Security Guide