aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-06 12:13:15 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 15:27:15 +0100
commit09393d3ef5c0b140ce5f1ddc2c3cae5b95119072 (patch)
treefaf7c27d7733fa1cac6a54ce4cad99a1226d5019
parent53ff8fbf97afa63192dbc43cc3900bfd84069af0 (diff)
check-certificates: handle formatting of self signed cert
-rw-r--r--check-certificates.rsc6
1 files changed, 5 insertions, 1 deletions
diff --git a/check-certificates.rsc b/check-certificates.rsc
index 1968641..e470b59 100644
--- a/check-certificates.rsc
+++ b/check-certificates.rsc
@@ -98,8 +98,12 @@
:global ParseKeyValueStore;
:local CertVal [ /certificate/get $Cert ];
- :local Return "";
+ :if ([ :typeof ($CertVal->"issuer") ] = "nothing") do={
+ :return "self-signed";
+ }
+
+ :local Return "";
:for I from=0 to=5 do={
:set Return ($Return . [ $EitherOr ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") \
([ $ParseKeyValueStore (($CertVal->"issuer")->0) ]->"CN") ]);