aboutsummaryrefslogtreecommitdiffstats
path: root/check-certificates.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-04-06 10:26:24 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-04-07 22:53:33 +0200
commit4073daa13990076c695a2d9c32208faf7415617b (patch)
tree89b9252d12ce21083fe3a9c9dcaff15a9e2d0c80 /check-certificates.rsc
parent706e4de6d1ed218ca689885621183ba42a9d62cf (diff)
check-certificates: include SANs in information
Diffstat (limited to 'check-certificates.rsc')
-rw-r--r--check-certificates.rsc11
1 files changed, 11 insertions, 0 deletions
diff --git a/check-certificates.rsc b/check-certificates.rsc
index 704ea15..6b35cbf 100644
--- a/check-certificates.rsc
+++ b/check-certificates.rsc
@@ -38,9 +38,20 @@
:return [ $CharacterReplace [ $CharacterReplace [ :tostr $1 ] "w" "w " ] "d" "d " ];
}
+ :local FormatSANs do={
+ :local SANs $1;
+ :local Return "";
+
+ :foreach SAN in=$SANs do={
+ :set Return ($Return . "\n " . $SAN);
+ }
+ :return $Return;
+ }
+
:return ( \
"Name: " . ($CertVal->"name") . "\n" . \
[ $IfThenElse ([ :len ($CertVal->"common-name") ] > 0) ("CommonName: " . ($CertVal->"common-name") . "\n") ] . \
+ [ $IfThenElse ([ :len ($CertVal->"subject-alt-name") ] > 0) ("SubjectAltNames:" . [ $FormatSANs ($CertVal->"subject-alt-name") ] . "\n") ] . \
"Private key: " . [ $IfThenElse (($CertVal->"private-key") = true) "available" "missing" ] . "\n" . \
"Fingerprint: " . ($CertVal->"fingerprint") . "\n" . \
"Issuer: " . ($CertVal->"ca") . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") . "\n" . \