localhost HTTPS SSL / TLS Origin: Network OSI layer 6 · Presentation Last updated 18 Nov 2026

HTTPS on localhost shows NET::ERR_CERT_AUTHORITY_INVALID — trust a local development certificate (mkcert)

A self-signed certificate for localhost or *.test isn't trusted by the browser, so dev servers show warnings.

Exact message you may see NET::ERR_CERT_AUTHORITY_INVALID localhostself signed certificate localhostmkcert localhost HTTPSYour connection isn't private localhost
Seen on: Chrome Node.js SSL

Meaning

Create a locally trusted CA and certificate with mkcert (mkcert -install && mkcert localhost 127.0.0.1 ::1), and point the dev server at the files. Include localhost, 127.0.0.1 and ::1 in the SAN. Chrome's chrome://flags/#allow-insecure-localhost is a last resort.

Common causes

  • Self-signed certificate without a trusted root
  • Missing SAN for localhost/127.0.0.1
  • Browser not restarted after trusting
  • Node/Python using their own CA store
  • Docker container using another certificate

⚡ Quick fix

  1. mkcert -install && mkcert localhost 127.0.0.1 ::1
  2. Configure the dev server with the key/cert
  3. Set NODE_EXTRA_CA_CERTS for Node tools

Detailed fix by platform

Shell

  1. bash
    mkcert -install
    mkcert localhost 127.0.0.1 ::1
    # vite: server.https = { key, cert }

How to diagnose

  1. Root — Installed?
  2. SAN — localhost + IPs?
  3. Tool — Uses system store?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

ACM region — CloudFront can't use my ACM certificate: it must be requested in us-east-1 (N. Virginia) (SSL / TLS)ACM regionALB listener — ALB HTTPS listener: CertificateNotFound / default certificate missing or SNI certificate list incomplete (SSL / TLS)ALB listenerDEPTH_ZERO_SELF_SIGNED_CERT — Node/OpenSSL: Error: self signed certificate (code: DEPTH_ZERO_SELF_SIGNED_CERT) (SSL / TLS)DEPTH_ZERO_SELF_SIGNE…Django — Django send_mail: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] (EMAIL_USE_SSL vs EMAIL_USE_TLS on the wrong port) (Email / SMTP)DjangoERR_CERT_AUTHORITY_INVALID — NET::ERR_CERT_AUTHORITY_INVALID (Your connection is not private) (JavaScript)ERR_CERT_AUTHORITY_IN…NODE_EXTRA_CA_CERTS — Node.js: UNABLE_TO_VERIFY_LEAF_SIGNATURE / SELF_SIGNED_CERT_IN_CHAIN behind a corporate proxy (NODE_EXTRA_CA_CERTS) (SSL / TLS)NODE_EXTRA_CA_CERTSSAN — Self-signed/CSR certificate rejected: no Subject Alternative Name (openssl req needs -addext) (SSL / TLS)SANTimeout during connect (likely firewall problem) — Let's Encrypt: Fetching http://example.com/.well-known/acme-challenge/token: Timeout during connect (likely firewall problem) (SSL / TLS)Timeout during connec…localhost…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.