From 9f4517f0fc606aff806ec9d2f1c995d4246cc2fd Mon Sep 17 00:00:00 2001 From: riceru <35490247+riceru@users.noreply.github.com> Date: Wed, 31 Jul 2019 14:39:30 +0200 Subject: [PATCH] Update ssl-cert-check I have openssl 1.1.0 (Debian 9) and the record separator is different. Now the record separator is a comma and not forward slash. There are also some blank spaces around the O. --- ssl-cert-check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssl-cert-check b/ssl-cert-check index 242e14d..c38a09c 100755 --- a/ssl-cert-check +++ b/ssl-cert-check @@ -725,8 +725,8 @@ check_file_status() { # Extract the issuer from the certificate CERTISSUER=$("${OPENSSL}" x509 -in "${CERT_TMP}" -issuer -noout | \ - "${AWK}" 'BEGIN {RS="/" } $0 ~ /^O=/ - { print substr($0,3,17)}') + "${AWK}" 'BEGIN {RS="," } $0 ~ /^ O =/ + { print substr($0,6,20)}') ### Grab the common name (CN) from the X.509 certificate COMMONNAME=$("${OPENSSL}" x509 -in "${CERT_TMP}" -subject -noout | \ @@ -743,7 +743,7 @@ check_file_status() { # Extract the issuer from the certificate CERTISSUER=$("${OPENSSL}" x509 -in "${CERTFILE}" -issuer -noout -inform "${CERTTYPE}" | \ - "${AWK}" 'BEGIN {RS="/" } $0 ~ /^O=/ { print substr($0,3,17)}') + "${AWK}" 'BEGIN {RS="," } $0 ~ /^ O =/ { print substr($0,6,20)}') ### Grab the common name (CN) from the X.509 certificate COMMONNAME=$("${OPENSSL}" x509 -in "${CERTFILE}" -subject -noout -inform "${CERTTYPE}" | \