From 797bd71cc8f001879da9c6cfa527002d0b9b6cea Mon Sep 17 00:00:00 2001 From: Robert Sander Date: Tue, 1 Oct 2024 10:28:11 +0200 Subject: [PATCH] removes " from issuer name to not confuse the JSON --- sslcertificates/agents/plugins/sslcertificates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sslcertificates/agents/plugins/sslcertificates b/sslcertificates/agents/plugins/sslcertificates index 6fdad1f3..52aaca55 100755 --- a/sslcertificates/agents/plugins/sslcertificates +++ b/sslcertificates/agents/plugins/sslcertificates @@ -50,7 +50,7 @@ get_cert_info() { cert_enddate_epoch=$(date --date "$cert_enddate" '+%s') cert_algosign=$($OPENSSL x509 -inform $inform -noout -text -in "$certfile" | awk '/Signature Algorithm: / { print $3; exit;}' ) cert_issuer_hash=$($OPENSSL x509 -inform $inform -noout -issuer_hash -in "$certfile" ) - cert_issuer=$($OPENSSL x509 -inform $inform -noout -issuer -in "$certfile" | sed -e 's/ = /=/g' -e 's/, /,/g' -e 's/issuer=//') + cert_issuer=$($OPENSSL x509 -inform $inform -noout -issuer -in "$certfile" | sed -e 's/ = /=/g' -e 's/, /,/g' -e 's/issuer=//' -e 's/"//g') echo "{\"file\": \"$certfile\", \"starts\": $cert_startdate_epoch, \"expires\": $cert_enddate_epoch, \"algosign\": \"$cert_algosign\", \"issuer_hash\": \"$cert_issuer_hash\", \"issuer\": \"$cert_issuer\", \"subj\": \"$cert_subject\"}" fi