Customer's clock is wrong: certificate errors and rejected codes
Short answer: When one customer says your site shows "Your connection is not private" with a date error, or that your app's two-factor codes are always "invalid", while everyone else is fine, check the clock on their device. Certificates are only valid between two dates, and authenticator codes change every 30 seconds, so a phone or computer set to the wrong date or time breaks both. Ask the customer to turn on automatic date and time, then reload or try a fresh code. On your side, add a support macro for it, give code-based logins a small clock tolerance, and make error messages hint at the cause.
Why a wrong clock breaks secure connections
Every HTTPS certificate has a validity period. RFC 5280, the standard profile for internet certificates, describes it as two dates: when the validity period begins (notBefore) and when it ends (notAfter). A browser checks the current time against those dates using the device's own clock.
If a laptop thinks it's three years ago, your perfectly valid certificate appears to start in the future. If the clock is far ahead, the certificate appears expired. Chrome reports errors like NET::ERR_CERT_DATE_INVALID and sometimes says the clock is behind or ahead; other browsers word it differently. Nothing is wrong with your site, but to the customer it looks broken or unsafe.
Typical causes:
- A dead motherboard battery in an older computer, resetting the date at each startup.
- Automatic time turned off to cheat a game timer, or after travel.
- A device that's been off for a long time.
- Work devices whose time sync is blocked by network rules.
Why a wrong clock breaks authenticator codes
Time-based one-time passwords (TOTP), used by authenticator apps, are defined in RFC 6238. The code is derived from the current time divided into steps, with a recommended default step of 30 seconds. The server computes the expected code from its own clock and compares.
If the customer's phone is a few minutes off, their app shows a code for the wrong time window, and your server rejects it every time. The RFC anticipates this: because of possible clock drift between client and server, it recommends that the validator accept a limited number of time steps out of sync, and notes the server can record detected drift for a token and adjust for it later.
Helping the customer
A short, friendly support reply works best:
- Check the date and time on the device, including the time zone.
- Turn on automatic date and time (on iPhone in Settings > General > Date & Time; on Android in Settings > System > Date & time; on Windows and Mac in the date and time settings).
- Restart the browser or app and try again.
- For authenticator apps, some offer a "sync time" option; otherwise the device clock fix is enough.
If the clock keeps resetting on a computer, the internal battery may need replacing, which is a job for whoever maintains their hardware.
What to change on your side
Add a support macro. Save a ready-made reply with the steps above. Most date-error and invalid-code tickets from a single customer resolve with it.
Allow small clock drift for TOTP. Check your authentication library's settings. Many accept one time step either side by default, following the RFC's guidance. Don't widen the window too far, as that weakens security.
Make error messages helpful. Instead of only "Invalid code", consider "That code didn't work. Codes change every 30 seconds; check that your phone's time is set automatically." For app-based HTTPS errors, log the error type so support can recognise a date problem.
Check your own servers' clocks too. Server time matters just as much. If your server's clock drifts, every customer's valid code may be rejected, and signed links or tokens may expire early or late. Make sure servers sync time automatically and alert you if they don't.
Offer fallback login methods. Backup codes, email-based recovery or passkeys keep customers from being locked out by a clock problem.
Telling the difference from a real certificate problem
| Situation | Likely cause |
|---|---|
| One customer, date error, others fine | Customer's clock |
| Everyone sees an expiry error | Your certificate actually expired |
| Some customers on old devices only | Old device trust stores or clock issues |
| All 2FA codes rejected for everyone | Your server's clock |
| One customer's codes always rejected | Their phone's clock |
Check your certificate's real dates with an online checker before replying to a customer, just to be sure.
Signed links and expiring sessions
Clock differences also affect links with time limits, such as password-reset links, download links and email verification links. These are usually checked on your server, so the customer's clock doesn't matter, but front-end code that checks expiry on the device does. If a customer's link says "expired" the moment they open it, check whether your app compares a server time with the device's clock. Comparing on the server avoids the problem entirely.
An illustrative example
A hypothetical Brisbane gym's member app used authenticator codes for staff logins. One receptionist's codes were rejected every morning. Her phone had automatic time turned off after a trip and was four minutes behind. Support sent the standard macro, the problem stopped, and the gym's developer added a hint about phone time to the "invalid code" message. A month later, a member's old laptop showing a date error on the booking site was solved with the same macro in one reply.
FAQ
Can I fix this from my server?
Not the browser certificate check; it uses the visitor's clock. You can tolerate small drift in TOTP codes.
Will widening the TOTP window make things insecure?
Slightly more lenient, so keep it small, as the RFC recommends.
Do SMS codes have the same problem?
Not usually, because the server generates and checks them, though expiry times still depend on your server's clock.
Could this be a network interception problem instead?
Sometimes. If the clock is right and only one network shows errors, look at the network.
If customers keep reporting certificate errors or rejected login codes and you'd like it diagnosed, describe what they see.