CertMon

SECURITY & CERTIFICATES

Fix NET::ERR_CERT_AUTHORITY_INVALID on localhost in Chrome on Mac

Chrome shows "Your connection is not private" and NET::ERR_CERT_AUTHORITY_INVALID for https://localhost or https://myapp.test. The code means one thing: Chrome could not link the certificate your server sent to a root certificate your Mac trusts. The certificate itself may be fine. Find out what the server is sending and who signed it, then trust that signer.

Start in Terminal: see what the server sends

Who is the certificate for, and who signed it?

openssl s_client -connect localhost:443 -servername myapp.test </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates

Does macOS trust it? Chrome reads the same trust settings.

security verify-cert https://myapp.test

Where is the issuer, and is there more than one copy?

security find-certificate -a -c "My Local Dev CA" -Z | grep -E 'SHA-256|keychain:'

Which certificates have you marked as trusted? The first command lists your account, the second all users.

security dump-trust-settings
security dump-trust-settings -d

verify-cert prints ...certificate verification successful. when macOS trusts the certificate for that name, and CSSMERR_TP_NOT_TRUSTED when no trusted root signed it. If the subject and issuer in the first command are the same, the certificate is self-signed.

The causes, and the fix for each

After fixing trust, reload the page. If Chrome still shows the old error, quit it with Command-Q and open it again.

When the error code is different

Once the issuer is trusted, Chrome checks the name and dates, and those failures have their own codes:

Clicking Advanced and then Proceed gets you the page, not a working site: service workers will not register on it, and requests to your API on another name fail until you accept that one too.

The easier way with CertMon

CertMon creates one local root CA, trusts it for SSL in your login keychain, and signs a certificate with the right Subject Alternative Name for every .test site it serves on port 443. Nothing is self-signed, and there is no leaf to re-trust when a certificate is renewed. The Trust & Devices tab shows whether the root is trusted, with a Repair Trust button if it is not, for example after a macOS update or a keychain reset. The root is limited by X.509 Name Constraints to .test and .localhost names, so trusting it never extends to a real website.

CertMon dashboard listing four .test sites, each forwarding to a localhost port and marked Active and Trusted.
Every site CertMon serves gets a certificate from a root your Mac already trusts.

Download CertMon free trial

Related guides