Skip to content

Add the egress proxy CA to the trust store of a box - #186

Merged
splitbrain merged 2 commits into
splitbrain:mainfrom
splitbrain-bot:system-ca
Nov 14, 2026
Merged

splitbrain merged 2 commits into
splitbrain:mainfrom
splitbrain-bot:system-ca

Conversation

@splitbrain-bot

Copy link
Copy Markdown

Summary: The egress proxy CA is now in the trust store that /etc/ssl/certs links to, so every tool that uses the system trust store accepts the certificates of the proxy. Before, only the tools that read one of the CA variables trusted the CA. Other tools, e.g., PHP with the curl extension, failed TLS on the intercepted hosts.

Changes:

  • The box image moves the system trust store to /etc/ssl/certs-system and makes /etc/ssl/certs a link to ~/.boxes/certs. In the image, ~/.boxes/certs links back to the system trust store, so build steps and update-ca-certificates in a custom image use it.
  • The entrypoint writes the same link into a home that has none. A login container and a new box thus have a working trust store before the setup.
  • boxes-setup copies the system trust store to ~/.boxes/certs.<random>/, adds the CA to the bundle file and as a hash link, and points ~/.boxes/certs at the copy. ~/.boxes/ca-bundle.crt links to the bundle file of the copy, so the CA variables and nix.conf keep working.
  • The docs describe the trust store in egress.md, with a diagram, and update boxes.md and custom-images.md.

Tests: the base image test makes a test CA, runs the setup, and checks the CA with openssl verify once with only the bundle file and once with only the hash links. I ran the setup step outside of an image with changed paths. I could not build the image or start a box, because Docker is not available here.

The box setup wrote the deployment CA only to ~/.boxes/ca-bundle.crt, and a
few environment variables pointed some tools to that file. Every other tool
used the system trust store and failed TLS on the intercepted hosts, for
example PHP with the curl extension.

The root file system of a box is read-only, so the box image moves the system
trust store to /etc/ssl/certs-system and makes /etc/ssl/certs a link to
~/.boxes/certs. In the image, that link points back to the system trust
store, so build steps and update-ca-certificates in a custom image use it.
The entrypoint writes the same link into a home that has none, so a login
container and a new box have a working trust store before the setup.

The setup copies the system trust store into the home, adds the CA to the
bundle file and as a hash link, and points ~/.boxes/certs at the copy.
~/.boxes/ca-bundle.crt links to the bundle file of the copy, so the CA
variables keep working for tools such as Node.
The docs said that only the tools that read the CA variables trusted the
egress proxy CA. They now describe the trust store in the home, which
/etc/ssl/certs links to, with a diagram of the links.
@splitbrain
splitbrain merged commit 560c0bc into splitbrain:main Nov 14, 2026
6 checks passed
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.

2 participants