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: 2023-09-07 20:43 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.