forked from mtusi2026/mtusi2026lab7
fix(pki): drain old connections after retiring the CA trust
This commit is contained in:
+5
-2
@@ -393,8 +393,6 @@ def rollover():
|
||||
"Not all active services renewed into new issuer"
|
||||
)
|
||||
fixture_check("retired-ca-lb")
|
||||
# Allow old L4 connections to expire, then remove old trust everywhere.
|
||||
time.sleep(46)
|
||||
# Keep the native Bao listener and LB well within their TTL across
|
||||
# the explicit listener restarts needed to retire client CA trust.
|
||||
repair(operator, "openbao")
|
||||
@@ -413,17 +411,22 @@ def rollover():
|
||||
write_private(OPERATOR / "ca.pem", public(new_root))
|
||||
write_private(TRUST / "ca.pem", public(new_root), mode=0o644)
|
||||
journal["phase"] = "old_trust_retired"
|
||||
journal["old_trust_removed_at"] = time.time()
|
||||
write_private(directory / "state.json", json.dumps(journal) + "\n")
|
||||
finally:
|
||||
operator.close()
|
||||
reload_lb()
|
||||
reload_bao()
|
||||
# Once old trust is removed, no new old-CA connections can enter.
|
||||
# Wait out the absolute 45-second lifetime of any established L4 hop.
|
||||
time.sleep(46)
|
||||
assert fixture.not_valid_after_utc.timestamp() > time.time(), (
|
||||
"CA retirement must be proved with an unexpired old-CA certificate"
|
||||
)
|
||||
fixture_check("retired-ca-lb", reject=True)
|
||||
fixture_check("lb")
|
||||
journal["phase"] = "complete"
|
||||
journal["retirement_completed_at"] = time.time()
|
||||
write_private(directory / "state.json", json.dumps(journal) + "\n")
|
||||
return {
|
||||
**journal,
|
||||
|
||||
Reference in New Issue
Block a user