Fixes

Fix

Certificate not yet valid or expired on one machine

When one machine sees a good certificate as not yet valid or expired, its clock is wrong. Fix the time with NTP, not the certificate.

Likely causes

  1. The machine's clock is off by months or years: no NTP, or NTP following a wrong server.
  2. The certificate really has expired: then every machine fails, not just one.

Diagnose

Run these in order. The output is what each printed on a lab's real Linux machines.

laptop:~# curl -sS https://tides.lab/
With the right time the certificate is fine.
hello from tides
laptop:~# faketime -f '-730d' curl -sS https://tides.lab/
Two years slow: certificate is not yet valid.
curl: (60) SSL certificate problem: certificate is not yet valid
…
laptop:~# faketime -f '+730d' curl -sS https://tides.lab/
Two years fast: certificate has expired.
curl: (60) SSL certificate problem: certificate has expired
…
laptop:~# chronyc sources
Two time servers disagree by an hour and neither is trusted (x): the clock has nobody to follow.
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^x clockA                        1   0   377     1  +4036ns[+6690ns] +/-   37us
^x clockC                        2   0   377     1   -3600s[ -3600s] +/-   53us

Fix

chronyc add server 10.0.2.32 iburst minpoll 0 maxpoll 1
Add another time server, so the good ones outvote the wrong one.

The fix the lab's challenge "The laptop is an hour out and calls it fine" checks.

laptop:~# chronyc sources
^* marks the server the clock now follows; the wrong one stays x.
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* clockA                        1   0   377     1  +4036ns[+6690ns] +/-   37us
^+ clockB                        2   0   377     1    +34us[  +36us] +/-   85us
^x clockC                        2   0   377     1   -3600s[ -3600s] +/-   53us

Break it and fix it yourself

Each lab is a small network of real Linux machines in your browser, where this fault happens.

Open NTP: keep every clock on the network honest

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab