Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Fixes #25564 - Generates proper output #723

Closed
wants to merge 2 commits into from
Closed

Fixes #25564 - Generates proper output #723

wants to merge 2 commits into from

Conversation

patilsuraj767
Copy link

This issue was caused because the fix in the following RFE.

[RFE] katello-certs-check to distinguish between Satellite and Capsule
https://projects.theforeman.org/issues/22694

Code snippet

HOSTNAME=$(hostname -f)
CERT_HOSTNAME=$(openssl x509 -noout -subject -in $CERT_FILE | sed -e 's/^subject.*CN=\([a-zA-Z0-9\.\-]*\).*$/\1/')

if [ $EXIT_CODE == "0" -a $CERT_HOSTNAME == $HOSTNAME ]; then
echo -e "${GREEN}Validation succeeded${RESET}\n"
    cat <<EOF

To install the Katello main server with the custom certificates, run:

    satellite-installer --scenario satellite\\
                      --certs-server-cert "$(readlink -f $CERT_FILE)"\\
                      --certs-server-key "$(readlink -f $KEY_FILE)"\\
                      --certs-server-ca-cert "$(readlink -f $CA_BUNDLE_FILE)"

Issue is we are checking the hostname against the cert CN and in case of wildcard cert CN is *.example.com. So this condition fails in case of wildcard certs that are to be installed in the satellite server.

Need to modify the logic, better to give the user the ability to define target for which cert to be generated.

katello-certs-check -t foreman -c /customcerts/cert_crt.pem -k /customcerts/cert_key.pem -b /customcerts/CA_crt.pem

@theforeman-bot
Copy link

Issues: #25564

@chris1984
Copy link
Member

@ekohl want me to test this with the custom certs I have?

@ekohl
Copy link
Member

ekohl commented Dec 14, 2018

This repository has been deprecated and merged into https://github.com/theforeman/foreman-installer (#731). If this is still relevant, please resubmit the PR there.

@ekohl ekohl closed this Dec 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants