pkg/rhsm: use Katello CA as default on Satellite hosts - #2613
Open
lzap wants to merge 1 commit into
Open
Conversation
On Satellite-registered hosts, content is served through the Satellite content proxy whose TLS certificate is signed by the Katello CA. The default redhat-uep.pem only contains the Red Hat CDN CA and cannot validate these certificates, causing TLS failures when fetching packages from RHSM-backed repositories. When /etc/rhsm/ca/katello-server-ca.pem exists (installed by Satellite registration), use it as the default CA. This single-point fix works across all download backends (curl, librepo, dnf) since they all read the default CA from the same Subscriptions class. A repo's explicit sslcacert still takes precedence. A hybrid approach combining the RHSM CA and the system CA bundle was rejected because the three download backends configure CA certs differently (librepo has no LRO_SSLCAPATH, dnf does not expose sslcapath), making a reliable cross-backend setup fragile. Mirrors osbuild PR osbuild#2537. SAT-37848 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
supakeen
approved these changes
Aug 25, 2026
| if _, err := os.Stat(katelloCACert); err == nil { | ||
| return katelloCACert | ||
| } | ||
| return "/etc/rhsm/ca/redhat-uep.pem" |
Member
There was a problem hiding this comment.
Maybe make both consts and swap between them? I dunno, stylistic only.
| assert.Equal(t, "/etc/rhsm/ca/redhat-uep.pem", defaultCACert()) | ||
|
|
||
| // Katello CA present: prefer it. | ||
| present := filepath.Join(t.TempDir(), "katello-server-ca.pem") |
Member
There was a problem hiding this comment.
It doesn't matter but why an additional present var here, can't it just assign directly to katelloCACert?
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.
On Satellite-registered hosts, content is served through the Satellite content proxy whose TLS certificate is signed by the Katello CA. The default
redhat-uep.pemonly contains the Red Hat CDN CA and cannot validate these certificates, causing TLS failures when fetching packages from RHSM-backed repositories.When
/etc/rhsm/ca/katello-server-ca.pemexists (installed by the Satellite registration process), use it as the default CA. This single-point fix works transparently across all download backends (curl, librepo, dnf) since they all read the default CA from the sameSubscriptionsclass. When a repo file explicitly setssslcacert, that value still takes precedence.A hybrid approach combining the RHSM CA and the system CA bundle was rejected because the three download backends configure CA certs differently (librepo has no
LRO_SSLCAPATH, dnf does not exposesslcapath), making a reliable cross-backend setup fragile and hard to test.Mirrors osbuild PR osbuild/osbuild#2537.
Jira: https://redhat.atlassian.net/browse/SAT-37848
🤖 Generated with Claude Code