Inside CertCLM: pull agents, local keys and multi-CA failover
The first article laid out the problem. This one explains the architecture we chose — and the reasoning behind the three decisions that shape everything else.
Decision 1: agents pull — no inbound path to your servers
Most deployment systems push: a control node SSH-es or API-calls into each host. That model requires inbound connectivity, host credentials stored centrally, and a network path that's often forbidden in segmented environments.
CertCLM agents pull. The agent dials out to the control plane over HTTPS, asks for work, does it, reports back. Consequences that follow directly:
- No inbound firewall changes — works behind NAT, in DMZs, in customer networks where nothing inbound is permitted
- No host credentials required — the pull model stores zero SSH keys or passwords; a compromised server can't pivot into the fleet. (SSH push targets are the explicit opt-in exception for hosts that can't run an agent — those credentials stay AES-256-GCM-encrypted)
- Horizontal by nature — agents connect whenever they're up; adding a node is enrollment, not plumbing
The agent's API is deliberately narrow: poll tasks, submit CSRs, report status. It can't list certificates, touch DNS credentials, or see other nodes.
Decision 2: private keys never leave the node
Push-based deployment implies the server holds the private key to deliver it — a centralized key store is a breach multiplier.
The pull agent instead generates the keypair locally and submits only a Certificate Signing Request. The CA signs the CSR; the agent receives the certificate and writes it next to the key it already has. The server never possessed the key — it couldn't leak it.
This constraint cascades correctly: agent-held certificates refuse server-side export and refuse pushing to third-party targets, because both would require the key. Where a managed service legitimately needs the key (a CDN must terminate TLS), the push model stores it AES-256-GCM-encrypted and delivers over TLS — the exception is explicit and visible, not an accident of architecture.
Decision 3: CAs are a failover chain, not a singleton
CA outages are real: rate limits, regional blocking, API incidents, policy changes. A renewal that depends on one CA is a renewal with an SLA you don't control.
Every CertCLM order carries a primary CA plus an ordered backup list (Let's Encrypt, ZeroSSL, Google Trust Services, and the built-in private CA). On any primary failure, the orchestrator runs the complete order against the next CA — fresh challenge, fresh order, no half-state — and records which CA actually issued. Failovers are visible in the UI, audit log, and notifications.
Each CA keeps its own ACME account key (acme-accounts/), and ZeroSSL/Google EAB credentials arrive via environment variables — secrets never enter argv or the database.
The supporting cast
- SQLite + modernc — zero-dependency storage; the whole state is one file plus
acme-accounts/. Backup iscp. - In-process REST bridge — the desktop app calls the identical REST surface through an in-process binding with a session token; there's no separate "desktop API" to drift out of sync.
- Built for short lifetimes — renewal fires at ~1/3 of whatever validity the CA issued, so the machinery is already correct when the 47-day mandate arrives, not when you notice it.
Next: DNS-01 in practice — wildcards, provider credentials, and the _acme-challenge delegation pattern that keeps your main zone read-only.