From 09393d3ef5c0b140ce5f1ddc2c3cae5b95119072 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 6 Mar 2024 12:13:15 +0100 Subject: check-certificates: handle formatting of self signed cert --- check-certificates.rsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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") ]); -- cgit v1.2.3-70-g09d2