fix: do not use cert '-subj' with hostname to generate cert, use subjectAltName#24
Merged
Merged
Conversation
📝 WalkthroughWalkthroughThe pull request modifies the KBS server certificate generation in the Ansible task file, removing the hostname-derived common name from the certificate subject while preserving the organization value. The OpenSSL subject now contains only ChangesKBS Certificate Subject Configuration
🚥 Pre-merge checks | ✅ 4 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Author
|
[citest] |
spetrosi
approved these changes
Jun 10, 2026
…ectAltName Cause: The code was using openssl -subj /CN=$(hostname) to generate the cert used for the server. The argument to '-subj' has a maximum length of 64 characters, but the hostname is longer than that. Consequence: The role would issue an error attempting to generate the certificate if the hostname was too long. Fix: Do not use '-subj' with the hostname. Certificate verification uses subjectAltName and the role was already using this in the generated cert. However, we have to have something in `-subj` otherwise openssl will prompt for input, so we just use `/O=Red Hat` as is used with the token signer. Result: The role can generate certificates which are secure without an error when the hostnames are too long for `-subj`. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
0b68005 to
2ca9051
Compare
Contributor
Author
|
[citest] |
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.
Cause: The code was using openssl -subj /CN=$(hostname) to generate the
cert used for the server. The argument to '-subj' has a maximum length
of 64 characters, but the hostname is longer than that.
Consequence: The role would issue an error attempting to generate the
certificate if the hostname was too long.
Fix: Do not use '-subj' with the hostname. Certificate verification uses subjectAltName
and the role was already using this in the generated cert. However, we have
to have something in
-subjotherwise openssl will prompt for input, so wejust use
/O=Red Hatas is used with the token signer.Result: The role can generate certificates which are secure without an
error when the hostnames are too long for
-subj.Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by CodeRabbit