fix: write embedded CA bundle to disk for child process TLS validation#1326
Draft
adamshiervani wants to merge 1 commit intodevfrom
Draft
fix: write embedded CA bundle to disk for child process TLS validation#1326adamshiervani wants to merge 1 commit intodevfrom
adamshiervani wants to merge 1 commit intodevfrom
Conversation
#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.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rootcertsCA bundle to/tmp/jetkvm-cacerts.pemat startup so child processes can validate TLS certificatesnewTailscaleCommand()helper that injectsSSL_CERT_FILEinto tailscale subprocess environmentx509: certificate signed by unknown authority) for tailscale operations on a device that ships no system CA storeCloses #1321
Closes #1096
Note
This branch predates #1318 which moved tailscale logic into
internal/tailscale/. The newrunTailscaleCommand()ininternal/tailscale/tailscale.go:63also spawns tailscale subprocesses viaexec.CommandContextwithoutSSL_CERT_FILE— needs to be updated to use the same pattern before this PR is marked ready.Test plan
/tmp/jetkvm-cacerts.pemexists after boottailscale updateand confirm TLS validation succeedsinternal/tailscale/tailscale.goto injectSSL_CERT_FILEin its subprocess calls