Breaking change release. Plaintext HTTP listener removed. The certctl control plane now terminates TLS 1.3 on :8443 via http.Server.ListenAndServeTLS. No CERTCTL_TLS_ENABLED=false escape hatch. No dual-listener mode. One-step cutover per docs/upgrade-to-tls.md. Server - cmd/server/tls.go: certHolder with SIGHUP hot-reload + atomic cert swap, buildServerTLSConfig (TLS 1.3 min, GetCertificate callback), preflightServerTLS validation - cmd/server/main.go: ListenAndServeTLS in place of ListenAndServe, watchSIGHUP wiring, cert/key path config threading - tls_test.go: 418-line regression coverage of reload, preflight, callback behavior, SAN validation Config - CERTCTL_TLS_CERT_PATH / CERTCTL_TLS_KEY_PATH (required) - Plaintext rejection: agents/CLI/MCP pre-flight-fail on http:// URLs with a pointer to docs/upgrade-to-tls.md Agents, CLI, MCP - All three pre-flight-reject http:// URLs with fail-loud diagnostic - CERTCTL_SERVER_CA_BUNDLE_PATH for private-CA trust - CERTCTL_SERVER_TLS_INSECURE_SKIP_VERIFY for dev-only bypass (loud warning on startup) - install-agent.sh emits both vars as commented template lines docker-compose - certctl-tls-init sidecar generates SAN-valid self-signed cert into deploy/test/certs/ on first boot - All demo-stack curls pin against ca.crt with --cacert Helm chart - Three TLS provisioning modes, exactly one required: - server.tls.existingSecret (operator-supplied) - server.tls.certManager.enabled (cert-manager integration) - server.tls.selfSigned.enabled (eval only — not for production) - server-certificate.yaml template for cert-manager mode - helm install without a TLS source fails at template render with a pointer to docs/tls.md CI - .github/workflows/ci.yml Helm Chart Validation step renders the chart in both existingSecret and cert-manager modes, plus an inverse guard-regression test that asserts helm template MUST refuse to render when no TLS source is configured. Previously the single `helm template` invocation hit the certctl.tls.required fail-loud guard and exit-1'd CI. Four invocations now: lint (existingSecret), template (existingSecret), template (cert-manager), template (no args — must fail). Integration tests - deploy/test/integration_test.go stands up the Compose stack over HTTPS, extracts the CA bundle, and exercises every certctl API over https://localhost:8443 - All 34 integration subtests green (per Phase 8 local CI-parity) Documentation - New: docs/tls.md (provisioning patterns, rotation, SIGHUP reload) - New: docs/upgrade-to-tls.md (one-step cutover, no-downgrade warnings, fleet-roll sequencing) - CHANGELOG.md: v2.2.0 "HTTPS Everywhere — The Irony" entry (file heading unchanged; release tag is v2.0.47) - All curls in docs/, examples/, deploy/helm/ guides use https://localhost:8443 --cacert Verification - grep -rn "ListenAndServe[^T]" cmd/ internal/ → 0 hits - grep -rn "\"http://" cmd/ internal/ → 2 benign hits (Caddy admin API default, SSRF doc comment) — zero certctl endpoints - Tasks #197–#206 (Phases 0–8) all closed in the tracker Files: 65 changed, 3489 insertions, 372 deletions (pre-CI-fix).
5.9 KiB
Changelog
All notable changes to certctl are documented in this file. Dates use ISO 8601. Versions follow Semantic Versioning.
[2.2.0] — 2026-04-19
HTTPS Everywhere — The Irony
certctl manages other teams' certificates. Until v2.2, it didn't terminate TLS on its own control plane. We treated the server as an internal service sitting behind whatever TLS-terminating infrastructure the operator already owned — reverse proxies, Kubernetes Ingress controllers, service mesh sidecars. Working through an EST coverage-gap audit surfaced this as a credibility problem we wanted to fix head-on: a cert-lifecycle product should ship with HTTPS by default. This release flips that. Self-signed bootstrap for docker-compose demos, operator-supplied Secret for Helm (with optional cert-manager integration), and a one-step cutover with no backward-compat bridge. Out-of-date agents will fail at the TLS handshake layer on upgrade; the upgrade guide walks operators through the roll.
Breaking Changes
- HTTPS-only control plane. The plaintext HTTP listener is gone. There is no
CERTCTL_TLS_ENABLED=falseescape hatch and no:8080fallback. Operators who were running certctl behind their own TLS terminator must either (a) continue doing so and let the downstream TLS terminator talk to certctl's HTTPS listener, or (b) bring their own cert/key and terminate on certctl directly. Either path requires config changes — seedocs/upgrade-to-tls.mdfor a one-step cutover. - Agents reject
CERTCTL_SERVER_URL=http://...at startup. This is a pre-flight config validation failure with a fail-loud diagnostic pointing atdocs/upgrade-to-tls.md. Not a TCP-refused, not a TLS-handshake-error — the agent will not even attempt the network call. Every agent deployment must be reconfigured before upgrading the server. - CLI and MCP clients require
https://URLs. Same pre-flight rejection of plaintext schemes. - TLS 1.2 is not supported. TLS 1.3 only. The server's
tls.Config.MinVersionis pinned totls.VersionTLS13. Any client still negotiating TLS 1.2 will fail at the handshake. Modern curl, Go stdlib, browsers, and Kubernetes tooling all default to 1.3-capable; legacy clients may need an upgrade. - Helm chart requires a TLS source.
helm installwithout one ofserver.tls.existingSecret,server.tls.certManager.enabled, or (for eval only)server.tls.selfSigned.enabledfails at template time with a diagnostic pointing atdocs/tls.md. There is no default-to-plaintext path.
Added
- Self-signed bootstrap for Docker Compose demos. A
certctl-tls-initinit container runs before the server on first boot, generates a SAN-valid self-signed cert intodeploy/test/certs/, and exits. The server mounts the resulting cert/key. Every curl in the demo stack pins against./deploy/test/certs/ca.crtwith--cacert. - Helm chart TLS provisioning — three modes. Operator-supplied Secret (
server.tls.existingSecret), cert-manager integration (server.tls.certManager.enabledwith issuer selection), or self-signed (server.tls.selfSigned.enabled— eval only, not supported for production). Chart templates enforce exactly one is active. - Hot-reload of TLS cert/key on
SIGHUP. Overwrite the cert/key on disk, sendSIGHUPto the server PID, watch theslog.Info("tls.reload", ...)log line, and new TLS connections use the new cert. Failure during reload is logged and does not crash the server; the previous cert remains in use. - Agent CA-bundle env vars.
CERTCTL_SERVER_CA_BUNDLE_PATHpoints at a PEM file the agent's HTTP client will trust.CERTCTL_SERVER_TLS_INSECURE_SKIP_VERIFYdisables verification (development only — the agent logs a loud warning at startup).install-agent.shwrites both as commented template lines into the generatedagent.env. - Integration test suite runs over HTTPS.
go test -tags=integration ./deploy/test/...stands up the full Compose stack, extracts the self-signed CA bundle, and exercises every certctl API overhttps://localhost:8443. All 34 subtests green. docs/tls.md— cert provisioning patterns: bring-your-own Secret, cert-manager, self-signed bootstrap, SAN requirements, rotation workflows, SIGHUP reload semantics, troubleshooting.docs/upgrade-to-tls.md— one-step cutover guide for existing v2.1 operators. Walks through the agent fleet roll, Helm upgrade sequencing, downgrade-is-not-supported warnings, and cert-provisioning decision tree.
Changed
cmd/server/main.gonow callshttp.Server.ListenAndServeTLS(certFile, keyFile). The plaintextListenAndServecode path is deleted —grep -rn "ListenAndServe[^T]" cmd/ internal/returns zero hits.- All documentation curls (
docs/testing-guide.md,docs/quickstart.md,deploy/helm/INSTALLATION.md,deploy/helm/DEPLOYMENT_GUIDE.md,deploy/ENVIRONMENTS.md,docs/openapi.md, migration guides, example READMEs) usehttps://localhost:8443and--cacertagainst the demo stack's bundle. - OpenAPI spec (
api/openapi.yaml)serversblocks default tohttps://localhost:8443.
Security
- TLS 1.3 pinned via
tls.Config.MinVersion = tls.VersionTLS13. - Plaintext HTTP listener removed entirely — no port 8080, no
Upgrade-Insecure-Requests, no HSTS-required redirect dance. There is only one port: 8443, TLS 1.3. grep -rn "http://" cmd/ internal/returns zero hits outside test fixtures and the agent-side URL-scheme rejection error message.
Upgrade Notes
Read docs/upgrade-to-tls.md before upgrading. The short version:
- Pick a TLS source — bring-your-own cert, cert-manager, or self-signed bootstrap.
- Upgrade the server with TLS configured. First boot over HTTPS.
- Roll the agent fleet: set
CERTCTL_SERVER_URL=https://...and, if using a private CA,CERTCTL_SERVER_CA_BUNDLE_PATH. Old agents will fail loud at startup — expected. - Roll CLI/MCP clients the same way.
There is no backward-compat bridge. There is no dual-listener mode. The cutover is one step.