Fix "Your connection is not private" NET::ERR_CERT_DATE_INVALID and ERR_CERT_AUTHORITY_INVALID
Your connection is not private Attackers might be trying to steal your information from example.com (for example, passwords, messages, or credit cards). NET::ERR_CERT_DATE_INVALID
- NET::ERR_CERT_AUTHORITY_INVALID
- NET::ERR_CERT_COMMON_NAME_INVALID
- Your clock is behind. A private connection to example.com can’t be established because your computer’s date and time are incorrect. NET::ERR_CERT_DATE_INVALID
- Warning: Potential Security Risk Ahead. Error code: SEC_ERROR_EXPIRED_CERTIFICATE
- This Connection Is Not Private. This website may be impersonating “example.com” to steal your personal or financial information.
The browser rejects the site HTTPS certificate. ERR_CERT_DATE_INVALID: expired certificate or wrong computer clock. ERR_CERT_AUTHORITY_INVALID: self-signed certificate or incomplete chain. On your server, renew the certificate (certbot renew) and serve fullchain.pem; locally, create a trusted certificate with mkcert.
What this error means
To show a padlock, the browser checks three things: the certificate is within its validity period, it is signed by a recognised certificate authority (through a chain of intermediate certificates the server must send), and it covers the visited domain name. If one fails, Chrome shows this warning page with a precise code: DATE_INVALID for the date, AUTHORITY_INVALID for the signature, COMMON_NAME_INVALID for the name. It is not a browser bug: it can no longer guarantee you are talking to the real server. Command-line tools (curl, git, npm) have their own error for the same problem.
Common causes
- Expired certificate: the automatic Let’s Encrypt renewal (certbot, Caddy, hosting panel) failed without anyone noticing. Validity periods keep getting shorter.
- Wrong device clock: incorrect PC or phone date (BIOS battery, dual boot, time zone), so certificates look "not yet valid" or expired everywhere.
- Incomplete chain: the server only sends
cert.pemwithout the intermediate certificates; some browsers or devices cannot trace back to the authority. - Self-signed certificate locally (
https://localhost, Docker, dev server) or a name not covered (wwwmissing from the certificate). - Interception: antivirus with HTTPS scanning, corporate proxy or public Wi-Fi captive portal presenting its own certificate.
Step-by-step fix
-
Read the code and test from another device
Click "Advanced" to see the exact code. If the site works on your phone over mobile data but not on your PC, the problem is local (clock, antivirus, network); if it fails everywhere, it is the server.
-
Inspect the server certificate
Show the dates, the covered domain and the issuer.
Verify return code: 21 (unable to verify the first certificate)in the fulls_clientoutput means an incomplete chain.echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \ | openssl x509 -noout -subject -issuer -dates -ext subjectAltName echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | grep "Verify return code" -
Renew an expired Let’s Encrypt certificate
First test the renewal with a dry run to see the error (port 80 blocked, DNS changed), then renew and reload the web server. Check that the automatic timer is active.
sudo certbot renew --dry-run sudo certbot renew sudo systemctl reload nginx systemctl list-timers | grep certbot -
Serve the full chain
With nginx and certbot,
ssl_certificatemust point tofullchain.pem(certificate + intermediates), not tocert.pem. With Apache 2.4.8+, the same goes forSSLCertificateFile.ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; -
Fix the clock
Turn on automatic time sync. Windows: Settings > Time & language > Date & time > Sync now, or the command below in an administrator terminal.
# Windows (admin) w32tm /resync # macOS sudo sntp -sS time.apple.com # Linux sudo timedatectl set-ntp true -
Locally: a trusted certificate with mkcert
mkcert creates a local authority installed in your system and browsers, then certificates for
localhost. Install:brew install mkcert nss(macOS),choco install mkcert(Windows),sudo apt install mkcert libnss3-tools(Debian/Ubuntu). With Laravel Herd or Valet,herd secure/valet securedoes the same.mkcert -install mkcert localhost 127.0.0.1 ::1 // vite.config.js import fs from 'node:fs'; import { defineConfig } from 'vite'; export default defineConfig({ server: { https: { key: fs.readFileSync('localhost+2-key.pem'), cert: fs.readFileSync('localhost+2.pem'), }, }, });
Did this fix work for you?
Confirm it in one click: it will rise for the next developers stuck on the same error.
Keep it from coming back
- Monitor your certificate expiry (uptime monitor, email alert) instead of relying only on automatic renewal.
- Include every name you use in the certificate (
example.comandwww.example.com). - Never click "Proceed to the site (unsafe)" on a real site: only do it for your own local dev server, knowingly.
Frequently asked questions
The site works on my phone but not on my PC, why?
The server is fine: check the PC clock, the antivirus HTTPS scanning or the network proxy. An incomplete chain can also work on a device that already has the intermediate cached and fail on another.
curl or git also fail with "SSL certificate problem", is it the same?
It is the same family of problem seen by command-line tools, with their own certificate store. It has its own page, linked below.
What does NET::ERR_CERT_COMMON_NAME_INVALID mean?
The certificate is valid but for another name: for example issued for example.com while you visit www.example.com, or the host default certificate. Add the missing name to the certificate.
Useful tools for this error
Error finder
Paste an error message or a log: the tool recognises the error and opens the right fix.
HTTP status codes
All the common HTTP codes (401, 403, 404, 419, 429, 500, 502…): meaning, causes and what to do.
Timestamp converter
Converts a Unix timestamp (seconds, milliseconds, microseconds) to a readable date in any time zone, and back.
More Web, HTML & CSS errors
- Fix "Mixed Content: … requested an insecure resource" (HTTPS mixed content)
- Fix "Refused to apply style … MIME type ('text/html') is not a supported stylesheet MIME type"
- Fix "Failed to load module script: Expected a JavaScript module script … MIME type of text/html" (Vite, SPA)
- Fix "Refused to execute inline script because it violates the following Content Security Policy directive"
- Fix ERR_TOO_MANY_REDIRECTS "redirected you too many times" (redirect loop)
- Fix "ResizeObserver loop completed with undelivered notifications"
- Fix net::ERR_BLOCKED_BY_CLIENT (ad blocker, analytics, "ads" files)