ERR_CERT_AUTHORITY_INVALID
Chrome does not trust the proxy's root certificate. Where to install it on macOS, Windows and Linux, and which browsers and tools ignore the system store.
What it means
Chrome could not build a chain from the site's certificate to a trusted root (RFC 5280 § 6). A debugging proxy signs certificates with its own CA, and this error means that CA's root certificate is not installed.
Nearby errors mean something else:
ERR_CERT_COMMON_NAME_INVALID: name mismatch (RFC 9110 § 4.3.4);ERR_CERT_DATE_INVALID: the clock or the validity dates (RFC 5280 § 4.1.2.5);ERR_CERT_REVOKED: the certificate was revoked.
How to fix it
Install the proxy's root certificate into the store the browser reads.
macOS. Double-click the .pem or .cer (login keychain), open it,
expand Trust, set «When using this certificate» to Always Trust.
System-wide from a terminal:
sudo security add-trusted-cert -d -r trustRoot \
-k /Library/Keychains/System.keychain proxy-ca.pem
Windows. In «Install Certificate» pick Local Machine (or keep Current User for your account only), then «Place all certificates in the following store» → Trusted Root Certification Authorities. «Automatically select the certificate store» does not put it there.
PowerShell, as Administrator:
Import-Certificate -FilePath .\proxy-ca.cer `
-CertStoreLocation Cert:\LocalMachine\Root
Linux. The system store serves curl and most CLI tools. On Debian and
Ubuntu the file must be PEM named *.crt, or update-ca-certificates skips
it:
# Debian / Ubuntu
sudo cp proxy-ca.crt /usr/local/share/ca-certificates/proxy-ca.crt
sudo update-ca-certificates
# Fedora / RHEL
sudo cp proxy-ca.pem /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust
Chrome on Linux reads its NSS database, not this store. Import the certificate
there (certutil comes in libnss3-tools or nss-tools):
certutil -d sql:$HOME/.local/share/pki/nssdb -A -t "C,," -n proxy-ca -i proxy-ca.pem
That is the default path since Chrome 146. If ~/.pki/nssdb exists, Chrome
uses it instead: pass that path.
Then restart the browser completely.
Why it may still not work
Firefox. Since Firefox 120 it reads roots you added to the system store on Windows and macOS (Settings → Privacy & Security → Certificates, the third-party roots checkbox). On Linux it does not: Certificates → View Certificates → Authorities → Import.
The Chrome Root Store (default since Chrome 108 on Windows and macOS, 114 on Linux and ChromeOS, 115 on Android) replaces only the public CA list. A root added locally is still trusted for TLS over TCP.
Node.js, Python, curl, Java have their own lists:
NODE_EXTRA_CA_CERTS=/path/ca.pem, REQUESTS_CA_BUNDLE or SSL_CERT_FILE,
curl --cacert ca.pem, keytool -importcert into cacerts. A working browser
proves nothing about them.
No «Proceed anyway» button. The site uses HSTS (preloaded or
Strict-Transport-Security
seen earlier), and RFC 6797 § 12.1
forbids the button. Install the certificate.
ERR_PROXY_CERTIFICATE_INVALID is a different error
Chrome rejected the certificate of the proxy itself, reached over TLS. The site is not involved; the root certificate above does not help.
Chrome uses TLS to the proxy only when told to: a PAC file returns
HTTPS host:port instead of PROXY host:port, Chrome runs with
--proxy-server=https://…, or an extension or policy set the proxy. A
debugging proxy needs none of this: HTTPS goes through CONNECT tunnels. Set
it as a plain HTTP proxy: PROXY 127.0.0.1:7070 in a PAC file, or
--proxy-server=http://127.0.0.1:7070.
Without a debugging proxy, it is a corporate proxy: its certificate must match the proxy's host name. Ask its administrator.
See it on your own traffic
Once the root is trusted, you see the whole exchange: request, response, body. Before that, only a TLS handshake that starts and dies, as on a phone. In Solpuga the certificate is exported as PEM from Settings → Proxy. Where the certificate goes on each platform: Certificate Installation.
Related
- Android does not trust the proxy certificateApps built for Android 7+ ignore user-installed CAs. How to allow them in a debug build with network_security_config, and what it will not fix.
- How to see the traffic from an iPhone or an Android phonePhone and computer on one Wi-Fi, a proxy in the network settings, a root certificate with full trust. Four steps, and the five things that break them.