Skip to content

cluster: one-click upgrade to post-quantum certificates - #721

Merged
drudge merged 3 commits into
mainfrom
claude/project-thread-l5bpc9
Dec 3, 2026
Merged

drudge merged 3 commits into
mainfrom
claude/project-thread-l5bpc9

Conversation

@drudge

@drudge drudge commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Requested by Nick · project thread

Summary

Last PR of the post-quantum work. It adds a one-click upgrade for clusters made before #720, so they get the ML-DSA certificates without regenerating their PKI.

  • Cluster page: a new Post-Quantum Certificates card in the aside lists each node as ECDSA only, ML-DSA + ECDSA, or Public certificate (ACME or imported).
  • Button: on the primary, Upgrade to Post-Quantum is disabled until every member runs this release. A member's recorded ML-DSA signing key from cluster: sign heartbeats with ML-DSA-65 beside Ed25519 #719 marks that. While it's disabled, the card names the nodes still to update. The confirm dialog uses the neutral tone.
  • Manifest flag: the click sets pq_certificates in the manifest. Older releases ignore it.
  • Each node, every minute: if the flag is set and its anchor has no ML-DSA CA, it calls certificates.AddClusterPQ. That adds an ML-DSA CA to the anchor and an ML-DSA node certificate with the same names and expiry as the classical one. The node then reloads its HTTPS certificate and adopts the new anchor in memory, so no restart is needed. The anchor reaches the manifest through the next heartbeat, or straight away on the primary.
  • Order of writes: the node certificate is written before the anchor. Peers ask for the ML-DSA certificate only after the anchor reaches them, so an upgrade that's cut short leaves nothing for a peer to ask for, and the next try starts fresh.
  • Nodes not from Sable Private CA: a node whose certificate didn't come from Sable Private CA returns ErrNotGeneratedClusterPKI. It's skipped and not retried.
  • API: POST /ui/cluster/pq-certificates requires cluster.write.

Screenshots

Before After: ready
Waiting on a node Upgrading (dark) Done

Confirm dialog:

Phone width:

Compatibility

  • Downgrade: once a node is upgraded, it shouldn't go back below this release, because older releases can't read the ML-DSA CA in its anchor. The docs and the release notes say so.

Verification

  • cluster_pq_test.go: upgrades a classical PKI, checking that the anchor keeps its classical CA first, the classical certificate is unchanged, and the companion verifies against the new CA with the same names. A second upgrade changes nothing. Imported or foreign certificates are refused.
  • pq_certificates_test.go:
    • Enabling waits for every member, and only the primary can enable.
    • The primary upgrades at once and publishes its anchor.
    • A replica upgrades after it syncs, and its anchor reaches the manifest.
    • Each upgrade runs only once, and neither node asks for a restart.
    • A node without a generated PKI is skipped once.
  • cluster_pq_certificates_test.go: the card's states, a refusal while a node is outdated, and enabling.
  • Commands: go test ./internal/certificates ./internal/cluster ./internal/web ./internal/app ./docs, gofmt -l ., go vet, and go tool mage verify on the stacked branch.

Generated by Claude Code

@drudge drudge self-assigned this Dec 3, 2026
@drudge
drudge merged commit 5724bfd into main Dec 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant