From e562825bd9580dabdbccb1d1228ea62034e2f65d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 10 Apr 2019 14:15:41 +0200 Subject: check-certificates: try to fetch PEM and P12 file --- check-certificates | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/check-certificates b/check-certificates index 9013151..b163ba6 100644 --- a/check-certificates +++ b/check-certificates @@ -34,11 +34,17 @@ :error "No CertRenewUrl given."; } - / tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CommonName . ".pem"); - :foreach PassPhrase in=$CertRenewPass do={ - / certificate import file-name=($CommonName . ".pem") passphrase=$PassPhrase; + :foreach Type in={ ".pem"; ".p12" } do={ + :do { + / tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CommonName . $Type); + :foreach PassPhrase in=$CertRenewPass do={ + / certificate import file-name=($CommonName . $Type) passphrase=$PassPhrase; + } + / file remove [ find where name=($CommonName . $Type) ]; + } on-error={ + :log debug ("Could not download certificate file " . $CommonName . $Type); + } } - / file remove [ find where name=($CommonName . ".pem") ]; :local CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ]; :local CertNameNew [ / certificate get $CertNew name ]; -- cgit v1.2.3-54-g00ecf