fix(compat): skip dev-*.pem roots in production builds (PILOT-284)#194
fix(compat): skip dev-*.pem roots in production builds (PILOT-284)#194matthew-pilot wants to merge 1 commit into
Conversation
The daemon's WSS compat layer uses //go:embed roots/*.pem to embed trusted root CAs. This glob picks up dev-2026.pem unconditionally, shipping a development root cert in every production binary. This commit adds a skipDevPems flag (default true) that excludes files starting with "dev-" from the trust pool. In dev builds (-tags dev), roots_dev.go sets skipDevPems via init() so the development root is still available for local testing. The existing TestPinnedRoots_LoadsEmbeddedRoots is adjusted to skip gracefully when no production roots are embedded (transitional state until a prod root is minted via pilot-ca init-root). Closes PILOT-284
|
🤖 Hank — CI status Classification: The build/test failure is a genuine code defect: @matthew-pilot — fix or comment. Auto-classified at 2026-05-30T11:12:00Z. Re-runs on next push or check completion. |
Matthew PR Status — #194Title: fix(compat): skip dev-*.pem roots in production builds (PILOT-284) TicketsLabelsNone Files Changed
Next Actions
Auto-generated status check by matthew-pr-worker |
Matthew PR Explain — #194What this PR doesfix(compat): skip dev-*.pem roots in production builds (PILOT-284) Scope
TicketsFiles
Review Notes
Auto-generated explain by matthew-pr-worker |
Matthew PR Status — #194Title: fix(compat): skip dev-*.pem roots in production builds (PILOT-284) TicketsLabelsNone Files Changed
Next Actions
Auto-generated status check by matthew-pr-worker |
Matthew PR Explain — #194What this PR doesfix(compat): skip dev-*.pem roots in production builds (PILOT-284) Scope
TicketsFiles
Review Notes
Auto-generated explain by matthew-pr-worker |
What failed
The daemon's WSS compat layer uses
//go:embed roots/*.pemto embed trusted root CAs. This glob picks updev-2026.pemunconditionally, shipping a development root cert in every production binary. Any TLS cert signed by the dev root would be trusted by production daemons.Fix
Add a
skipDevPemsflag (defaulttrue) that excludes files starting withdev-from the trust pool inPinnedRoots(). In dev builds (go build -tags dev),roots_dev.gosetsskipDevPems = falseviainit()so the development root is still available.Verification
Post-merge: operator action needed
A production root must be minted (
pilot-ca init-root) and committed asinternal/transport/compat/roots/prod-*.pem. Until then, production binaries will warn at startup: "no embedded Pilot Protocol roots found." The-tags devescape hatch works for local development.Closes PILOT-284