Skip to content
  1. LuzineDebug
  2. Web, HTML & CSS
  3. Your connection is not private
Web, HTML & CSS Intermediate ≈ 15 min to fix

Fix "Your connection is not private" NET::ERR_CERT_DATE_INVALID and ERR_CERT_AUTHORITY_INVALID

Error message
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.
In short

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.

Be the first to confirm this fix

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

  1. Expired certificate: the automatic Let’s Encrypt renewal (certbot, Caddy, hosting panel) failed without anyone noticing. Validity periods keep getting shorter.
  2. Wrong device clock: incorrect PC or phone date (BIOS battery, dual boot, time zone), so certificates look "not yet valid" or expired everywhere.
  3. Incomplete chain: the server only sends cert.pem without the intermediate certificates; some browsers or devices cannot trace back to the authority.
  4. Self-signed certificate locally (https://localhost, Docker, dev server) or a name not covered (www missing from the certificate).
  5. Interception: antivirus with HTTPS scanning, corporate proxy or public Wi-Fi captive portal presenting its own certificate.

Step-by-step fix

  1. 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.

  2. 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 full s_client output means an incomplete chain.

    bash
    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"
  3. 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.

    bash
    sudo certbot renew --dry-run
    sudo certbot renew
    sudo systemctl reload nginx
    systemctl list-timers | grep certbot
  4. Serve the full chain

    With nginx and certbot, ssl_certificate must point to fullchain.pem (certificate + intermediates), not to cert.pem. With Apache 2.4.8+, the same goes for SSLCertificateFile.

    nginx
    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  5. Fix the clock

    Turn on automatic time sync. Windows: Settings > Time & language > Date & time > Sync now, or the command below in an administrator terminal.

    bash
    # Windows (admin)
    w32tm /resync
    # macOS
    sudo sntp -sS time.apple.com
    # Linux
    sudo timedatectl set-ntp true
  6. 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 secure does the same.

    bash
    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.com and www.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

More Web, HTML & CSS errors

All Web, HTML & CSS errors →