Skip to main content
Network & HTTP · Developer Error Resolution Lab

Fix 'NET::ERR_CERT_AUTHORITY_INVALID' and Self-Signed Certificate Errors

Resolve SSL/TLS certificate trust errors in development, curl, Node.js, and local HTTPS environments.

Triggered Error Message:

NET::ERR_CERT_AUTHORITY_INVALID / self signed certificate in certificate chain

Customize Solution for Your Environment
# Step 1: Install trusted local CA using mkcert
brew install mkcert # or choco install mkcert
mkcert -install

# Step 2: Generate trusted certs for localhost:
mkcert localhost 127.0.0.1 ::1

# In Node.js development only (.env.development):
# NODE_TLS_REJECT_UNAUTHORIZED=0 (DO NOT USE IN PRODUCTION)

Root Cause & Mechanism Analysis

Why does this error occur?

The browser or Node.js does not recognize the certificate authority that signed the SSL certificate (common with mkcert, self-signed dev certificates, or missing intermediate CA certificates).

Frequently Asked Questions

Why is NODE_TLS_REJECT_UNAUTHORIZED=0 dangerous?
It disables all SSL certificate validation, exposing network traffic to man-in-the-middle (MITM) attacks.
Browse All 35 Guides