--- a/check_cert.pl Mon Jan 07 13:07:28 2019 +0100
+++ b/check_cert.pl Mon Jan 07 14:04:59 2019 +0100
@@ -22,7 +22,7 @@
$opt_b = "/usr/bin/openssl";
$opt_s = "md5WithRSAEncryption";
-my $revision = '1.2.2';
+my $revision = '1.2.3';
Getopt::Long::Configure('bundling');
GetOptions(
@@ -99,7 +99,7 @@
while (<CERT>) {
/unable to load certificate/ and $rc = 1 and last;
/Signature\sAlgorithm:\s($opt_s)\s+$/ and $sig = $1;
- /^subject=\s.*CN=(.*)\s+$/ and $cn = $1;
+ /^subject=\s?.*CN\s*=\s*(.*)\s+$/ and $cn = $1;
/^notAfter=(.*)\s+$/ and $enddate = $1;
/^(SSL\sclient)\s:\sYes$/ and $cert_type = $1;
/^(SSL\sserver)\s:\sYes$/ and $cert_type = $1;
@@ -125,7 +125,7 @@
and print "CERT CRITICAL: unable to load certificate\n"
and exit $ERRORS{"CRITICAL"};
/Signature\sAlgorithm:\s($opt_s)\s+$/ and $sig = $1;
- /^subject=\s.*CN=(.*)\s+$/ and $cn = $1;
+ /^subject=\s?.*CN\s*=\s*(.*)\s+$/ and $cn = $1;
/^notAfter=(.*)\s+$/ and $enddate = $1;
/^(SSL\sclient)\s:\sYes$/ and $cert_type = $1;
/^(SSL\sserver)\s:\sYes$/ and $cert_type = $1;