Skip to content

cluster: add ML-DSA certificates for Sable peers beside ECDSA - #720

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

drudge merged 1 commit 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

Fourth PR of the post-quantum work (audit item 2). Nick chose "dual certs, ML-DSA for peers only".

Cluster nodes use the same HTTPS port and certificate as the console. Switching that certificate to ML-DSA would break every browser and phone. Instead, Sable Private CA now issues two certificate chains:

  • ECDSA (unchanged): cluster-ca.pem, node-certificate.pem. Browsers, phones and DNS clients always get this one.
  • ML-DSA-65 (new): a CA appended to cluster-ca.pem, and a node certificate at node-certificate-mldsa.pem / node-private-key-mldsa.pem with the same names and expiry.

How a peer asks for the ML-DSA certificate: a node offers the ALPN value sable-pq-peer only when its pinned anchor for the node it's calling contains an ML-DSA CA. The server returns the ML-DSA certificate only for a hello that offers the marker and can verify ML-DSA (SupportsCertificate). It never selects the marker as the protocol.

Why it can't deadlock:

  • A peer that hasn't received the new anchor yet doesn't ask, so it keeps verifying ECDSA.
  • A node with no companion files serves ECDSA, as before.

Key exchange is X25519MLKEM768 either way, from Go 1.27's defaults.

Compatibility

  • New clusters only: only newly generated PKIs get the ML-DSA chain. The next PR adds a one-click upgrade for existing clusters.
  • ACME and imported certificates: unchanged.
  • Older releases: Sable before 1.7.3 (Go before 1.27) can't parse an ML-DSA CA in a member's trust anchor. A new cluster therefore shouldn't take members older than 1.7.3. A rolling update within 1.10 is fine.

Verification

  • pq_certificate_test.go covers the HTTPS listener with real TLS 1.3 handshakes:
    • A browser-like hello gets ECDSA.
    • A peer that trusts both chains gets ML-DSA.
    • A peer still pinned to the old anchor gets ECDSA.
    • All three negotiate X25519MLKEM768.
    • The marker is never negotiated.
    • With no companion files, the listener serves ECDSA.
  • TestClassicalAnchorDoesNotAskForMLDSA and the updated TestPrivateClusterCATrustIsBundledAndPersistsOnReplica cover the client side.
  • Manually checked with headless Chromium through Playwright: it got the ECDSA "Sable Cluster CA" certificate over TLS 1.3.
  • Also run: go test ./internal/certificates ./internal/cluster ./internal/web ./docs, 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 a22582a 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