From b1eaefa01d7148c29dd6987177931f93d4aea11c Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 16 Sep 2024 14:57:37 +0200 Subject: [PATCH] correctly exit non zero when the SAN doesn't match (cherry picked from commit 03655d0abcd96a14cd4509324348a25642baf7a6) --- bin/katello-certs-check | 10 ++----- .../certs/foreman-bad-san.example.com.crt | 21 ++++++++++++++ .../certs/foreman-bad-san.example.com.key | 28 +++++++++++++++++++ .../katello-certs-check/create_cert.sh | 10 +++++++ spec/katello_certs_check_spec.rb | 14 +++++++++- 5 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 spec/fixtures/katello-certs-check/certs/foreman-bad-san.example.com.crt create mode 100644 spec/fixtures/katello-certs-check/certs/foreman-bad-san.example.com.key diff --git a/bin/katello-certs-check b/bin/katello-certs-check index 82f56856..680851be 100755 --- a/bin/katello-certs-check +++ b/bin/katello-certs-check @@ -210,15 +210,9 @@ function check-cert-san () { return fi done - error - echo "The $CERT_FILE does not have a Subject Alt Name matching the Subject CN" + error 11 "The $CERT_FILE does not have a Subject Alt Name matching the Subject CN" else - error - cat <