A visitor sends a screenshot: "Your connection is not private", your domain in the middle of it, and NET::ERR_CERT_DATE_INVALID underneath. You check the certificate. It is valid, it was renewed last week, and it works for you and for everybody else who has looked.
Nothing on that screen is lying, and the certificate is fine. A certificate is valid between two dates, and "date invalid" only means the browser's idea of now fell outside them. The browser's idea of now is the visitor's computer clock.
Chrome knows this, and it has a separate screen for it, "Your clock is behind" or "Your clock is ahead". The catch is that it only shows that screen when it can prove the clock is wrong. When it cannot, it shows the generic one, which reads as your fault.
How Chrome decides whose fault it is
The logic is in Chromium's components/ssl_errors/error_classification.cc, in a function called GetClockState. It has two ways to tell whether the system clock is wrong.
Network time. Chrome periodically asks a Google time service (clients2.google.com/time) what time it is. That is on by default everywhere except ChromeOS and iOS, where the feature is off. If it has a recent answer, it compares the system clock with it, allowing the measured uncertainty plus a five-minute fudge (kNetworkTimeFudge = base::Minutes(5)). Outside that window, the clock is declared wrong and you get the clock screen.
Build time, when there is no usable network time: no sync yet, sync lost, or the query failing. Then Chrome compares the clock with the date it was built:
if (now_system < build_time - base::Days(2)) {
build_time_state = CLOCK_STATE_PAST;
} else if (now_system > build_time + base::Days(365)) {
build_time_state = CLOCK_STATE_FUTURE;
}
Read the window. A clock more than two days earlier than the browser's own build date is impossibly early, and a clock more than a year later is suspicious. Anything in between is plausible, so Chrome cannot call it wrong, and it falls back to the ordinary certificate error.
So a laptop that has been off the network, with a clock that drifted or was set wrong, can be weeks out and still get the screen that names your domain rather than the screen that names their clock.
Why short-lived certificates make it more likely
The gap that matters is between the visitor's wrong clock and your certificate's start date. If your certificate became valid ten days ago, a clock running more than ten days behind is before its start, and the certificate is "not yet valid" for that visitor.
Ours, as I write this, started on 21 November. A ninety-day certificate renewed thirty days before it expires is always young, which means the window in which a slow clock lands before its start date is always open somewhere. The more recently you renewed, the smaller the clock error it takes. That is why reports like this tend to arrive in the days after a renewal, from one person, and then stop.
How to settle one in a minute
Read your certificate's dates:
openssl s_client -connect yourdomain.com:443 -servername yourdomain.com </dev/null \
| openssl x509 -noout -startdate -enddate
Then ask the visitor one thing: what date and time does their device show? If it is before your notBefore, you have the whole answer, and the fix is on their side: turn on automatic time.
If you want that fact in the report without asking, your own page can measure it. Same-origin responses expose the server's Date header, so the skew is one request away:
async function clockSkewSeconds() {
const res = await fetch("/", { method: "HEAD", cache: "no-store" });
const server = new Date(res.headers.get("Date")).getTime();
return Math.round((Date.now() - server) / 1000);
}
Date has one-second resolution, so ignore anything small. A skew of days is the finding.
What the report needed
"Your site says my connection is not private" is a true report that points at the wrong machine. The certificate is in your hands and checks out; the clock is in theirs and nobody thought to mention it, because to the person reporting, the time on their screen is not part of the problem. It is just the time.
Top comments (0)