Skip to content

fix: write embedded CA bundle to disk for child process TLS validation#1326

Draft
adamshiervani wants to merge 1 commit intodevfrom
fix-1321
Draft

fix: write embedded CA bundle to disk for child process TLS validation#1326
adamshiervani wants to merge 1 commit intodevfrom
fix-1321

Conversation

@adamshiervani
Copy link
Copy Markdown
Contributor

@adamshiervani adamshiervani commented Mar 24, 2026

Summary

  • Writes the embedded rootcerts CA bundle to /tmp/jetkvm-cacerts.pem at startup so child processes can validate TLS certificates
  • Adds newTailscaleCommand() helper that injects SSL_CERT_FILE into tailscale subprocess environment
  • Fixes TLS failures (x509: certificate signed by unknown authority) for tailscale operations on a device that ships no system CA store

Closes #1321
Closes #1096

Note

This branch predates #1318 which moved tailscale logic into internal/tailscale/. The new runTailscaleCommand() in internal/tailscale/tailscale.go:63 also spawns tailscale subprocesses via exec.CommandContext without SSL_CERT_FILE — needs to be updated to use the same pattern before this PR is marked ready.

Test plan

  • Deploy to device, verify /tmp/jetkvm-cacerts.pem exists after boot
  • Run tailscale update and confirm TLS validation succeeds
  • Verify no regression in tailscale status/connect flows
  • Update internal/tailscale/tailscale.go to inject SSL_CERT_FILE in its subprocess calls

#1321)

The device rootfs ships no system CA cert bundle (/etc/ssl/certs/ does not
exist), so child processes like `tailscale cert` and `tailscale update`
cannot validate TLS server certificates.

At startup, convert the embedded rootcerts DER certificates to PEM and write
them to /tmp/jetkvm-cacerts.pem. Inject SSL_CERT_FILE pointing to this bundle
into the environment of all tailscale subcommand invocations via a new
newTailscaleCommand() helper.
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.

feat: support tailscale cert and tailscale update on device Ship a working cert store so ssl works (tailscale updates etc)

1 participant