Add FORWARDER_CA_FILE environment variable support#5
Open
jeremylenz wants to merge 3 commits into
Open
Conversation
Allow the worker to specify a custom CA certificate file path for HTTPS connections to the Foreman server instead of relying solely on the system trust store. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
9 tasks
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
FORWARDER_CA_FILEenvironment variable so the worker can load a custom CA certificate for its HTTPS connection to the Foreman server, instead of relying on the system trust storehttp.Clientacross requests instead of creating one perSend()callThis unblocks foremanctl#569, which currently adds the Foreman CA to the system trust store — an anti-pattern the team has decided to avoid because it's not inherited by containers, it makes unrelated tools trust the CA, and it creates inconsistency across deployment methods.
When
FORWARDER_CA_FILEis set, the worker reads the PEM file and appends it to the system cert pool (with graceful fallback if the system pool is unavailable, e.g. in minimal containers). When unset, behavior is unchanged.On the foremanctl side, this enables adding the env var to the worker TOML config:
Test plan
Automated
make buildpassesmake testpasses (4 new tests + 1 existing)make vetpassesManual testing
Prerequisites: a working cloud connector setup (rhcd + yggdrasil-worker-forwarder) on a Foreman/Satellite server with HTTPS enabled.
Build and install the updated binary
1. Verify current setup works
2. Remove Foreman CA from system trust store
3. Confirm the worker now fails TLS verification
4. Configure FORWARDER_CA_FILE via foremanctl
Deploy the cloud-connector feature using the changes from foremanctl#569, which templates
FORWARDER_CA_FILEinto the worker TOML config at/etc/rhc/workers/foreman_rh_cloud.toml. Then restart the service:5. Confirm the worker connects successfully again
6. Clean up
🤖 Generated with Claude Code