Founding prices until 15 December: 30% off Pro, locked for life. See pricing

$ … x509: certificate has expired or is not yet valid

Certificate expired: renew it and stop it happening again

The certificate's validity window doesn't include the current time (or the client's clock is wrong).

Networking

What it means

Each certificate is valid between notBefore and notAfter. Past notAfter, clients refuse it. "Not yet valid" usually means the client's clock is behind.

Causes and fixes

Most likely first. Run the check, and if it matches, apply the fix.

1. The certificate expired and renewal didn't run or wasn't reloaded

Check:

openssl s_client -connect host:443 -servername host </dev/null 2>/dev/null | openssl x509 -noout -dates

Fix: Renew, reload the server so it serves the new file, and alert on expiry 2 to 3 weeks ahead.

2. The client's clock is wrong

Check:

date; timedatectl

Fix: Enable NTP (timedatectl set-ntp true).

Fix it yourself

A live machine in your browser with this problem already on it. The grader checks the result.

Open the lab

No account needed for your first tries.

Related errors