Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1758181 - katello-certs-check does not support wildcard certificates
Summary: katello-certs-check does not support wildcard certificates
Keywords:
Status: CLOSED DUPLICATE of bug 1658360
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Certificates
Version: 6.4.2
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: Unspecified
Assignee: Chris Roberts
QA Contact: Omkar Khatavkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-03 13:40 UTC by jeff.chapin@uni.edu
Modified: 2024-02-28 20:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-02 14:00:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description jeff.chapin@uni.edu 2019-10-03 13:40:06 UTC
Description of problem:
katello-certs-check reports that wildcard certificates are valid to use with satellite (correctly), but returns an error in the process 

Version-Release number of selected component (if applicable):


How reproducible:
100%


Steps to Reproduce:
1.# katello-certs-check -c sat_cert/satellite.domain.com.crt  -k sat_cert/satellite.domain.com.key  -b sat_cert/DigiCert.crt

...
/sbin/katello-certs-check: line 168: [: too many arguments
Validation succeeded
...

2. Line 168:

if [ $EXIT_CODE == "0" -a $CERT_HOSTNAME == $HOSTNAME ]; then

3. $CERT_HOSTNAME is set with:
CERT_HOSTNAME=$(openssl x509 -noout -subject -in $CERT_FILE | sed -e 's/^subject.*CN=\([a-zA-Z0-9\.\-]*\).*$/\1/')

4. On a valid wildcard, this regex fails:
# openssl x509 -noout -subject -in sat_cert/satellite.example.com.crt | sed -e 's/^subject.*CN=\([a-zA-Z0-9\.\-]*\).*$/\1/'

# openssl x509 -noout -subject -in sat_cert/satellite.example.com.crt
subject= /C=US/ST=STATE/L=CITY/O=EXAMPLE/CN=*.example.com

A corrected regex:
# openssl x509 -noout -subject -in sat_cert/satellite.example.com.crt | sed -e 's/^subject.*CN=\([a-zA-Z0-9\.\-]*|\*\).*$/\1/'
subject= /C=US/ST=STATE/L=CITY/O=EXAMPLE/CN=*.example.com


Actual results:
...
/sbin/katello-certs-check: line 168: [: too many arguments
Validation succeeded
...

Expected results:

...
Validation succeeded
...

Additional info:
Satellite has no issues with these certificates.

Comment 3 Stephen Wadeley 2019-11-19 16:23:41 UTC
See also:

Bug 1654326 - katello-certs-check gives the wrong output if using certificate with wildcard
Bug 1658360 - katello-certs-check is not showing satellite-installer command if wildcard SSL certificate is used.

Comment 4 Stephen Wadeley 2020-09-02 14:00:27 UTC

*** This bug has been marked as a duplicate of bug 1658360 ***


Note You need to log in before you can comment on or make changes to this bug.