What the message looks like
Your clock is ahead
NET::ERR_CERT_DATE_INVALID
This server could not prove that it is cloud.example.com; its security certificate expired or is not yet valid.Common causes
- The clock on the device is wrong: empty CMOS battery, a VM restored from a snapshot, a device without network time, or a wrong time zone or year.
- The server certificate really expired and was not renewed.
- The certificate is not yet valid (
notBeforein the future), often because the machine that issued it had a wrong clock. - A certificate in the chain, such as an intermediate, expired even though yours is fine.
Check
- Validity dates of the served certificate
echo | openssl s_client -connect cloud.example.com:443 -servername cloud.example.com 2>/dev/null | openssl x509 -noout -dates - What time does this machine think it is?
date -u - Is network time active?
timedatectl status - What does the server's own clock say?
curl -sI https://cloud.example.com | grep -i '^date:'
Fix
- Compare
notBeforeandnotAfterwith the current date. If today is inside the window on a correct clock, the problem is the client clock. - On the client, switch on network time:
sudo timedatectl set-ntp true, and fix the time zone. On phones and PCs use the automatic date and time setting. - In virtual machines, enable time sync with the host or run an NTP client, and correct the time after restoring a snapshot.
- If the certificate itself is expired, renew it and reload the web server. See the expired-certificate entry for the steps.
- If it is not yet valid, fix the clock of the issuing machine and issue the certificate again.
Typical scenario
Sunday morning, several users report NET::ERR_CERT_DATE_INVALID on the intranet portal. The certificate was a Let's Encrypt one, the renewal timer had stopped working since a package update, and nobody had set up an expiry warning. First read the notBefore and notAfter fields of the certificate actually served with openssl x509 -noout -dates and compare them with the current date, before you hunt for wrong client clocks.
FAQ
Why do only some users see this error?
Those users have a wrong device clock. If everyone sees it, the certificate or the server clock is the cause.
Why do other sites also fail on the same computer?
All HTTPS sites are checked against the same wrong clock, so a wrong date makes many sites fail at once. That is the clearest sign of a clock problem.
How long before expiry should I renew?
Let's Encrypt certificates last 90 days, and certbot renews by default when less than 30 days remain. Monitoring should warn at roughly 14 days of remaining lifetime at the latest. That leaves time to find a stuck timer or a changed firewall rule before users notice.
Are the dates in UTC or local time?
The notBefore and notAfter fields are in GMT, that is UTC. If a certificate is shown as expiring at 23:00, it ends one or two hours later in Central Europe depending on the season. Check with date -u how much time really remains.
Can a certificate also be not yet valid?
Yes. If notBefore lies in the future from the client's point of view, the same error appears. That happens with a client clock that is behind, for example after a dead BIOS battery, or when a certificate was only just issued and the server clock runs ahead.