The certificate expired 75 days early OPS-833

Open2 versionsNetworking · Medium · Investigate · about 25 min ·Linux, root

Lab machine

A private Linux machine with the problem already set up. Sessions last up to 60 minutes.
Sasha Lind opened OPS-833 at 06:40SEV-3

depot-7's scanners stopped printing at 06:10: certificate expired. Every other depot accepts the same certificate. Platform wants to renew it early.

The label service certificate is valid for weeks yet. From depot-7, it looks expired.

"Easiest fix is to renew it early, right? Takes five minutes." (Sasha)

A certificate has a start and an end date. A client decides whether it is valid by comparing those dates with its own clock. If the client's clock is wrong, a perfectly good certificate looks expired or not yet valid.

Your task

Prove whether the certificate or the clock is wrong, then fix the cause: give the depot a working time source so its clock corrects itself and the scanners recover. Renewing the certificate or turning off verification does not count.

On the machine

  • /var/log/depot/scanner.log
  • depot-timesync status
  • depot-run date, depot-run openssl s_client … (commands on the depot's clock)
  • /etc/depot/timesync.conf

Timeline

Sepntp1.depot7 is decommissioned with the old rail-yard switch.
Overnightdepot-7's clock drifts further ahead with nothing to correct it.
06:10Scanners: "certificate has expired". Printing stops at the rail yard.
06:40OPS-833: "Shall I just renew the cert?"

Done when

  1. The depot clock is synchronised from a working time source.
  2. The scanners reach the label service with normal certificate verification, and the certificate was not replaced.

Hints

Hint 1

Read the scanner log's timestamps. What date does the depot think it is?

Hint 2

`openssl s_client -connect labels.northstar.example:8443 </dev/null 2>/dev/null | openssl x509 -noout -dates` shows the certificate's validity.

Hint 3

`depot-timesync` shows which server the depot asks, whether it answers, and whether the daemon refused to correct the clock.

Hint 4

Compare /etc/depot/timesync.conf with /etc/depot/README: the right time source, and any setting that keeps the clock from being corrected.

Show the solution

The certificate is valid; the depot's clock is 75 days fast, so to depot programs it looks expired. `depot-timesync` says why it stays wrong. Either the only configured server, ntp1.depot7, gets no response because it was retired: point /etc/depot/timesync.conf at time.northstar.example. Or the server is right and answers, but `maxstep 1000` refuses a 75-day correction: remove that line (or raise it past the offset). Within seconds the depot clock synchronises and the scanner's requests succeed. Renewing the certificate would not have helped.