aboutsummaryrefslogtreecommitdiffstats
path: root/check-certificates
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-04-10 14:15:41 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-04-10 14:29:24 +0200
commite562825bd9580dabdbccb1d1228ea62034e2f65d (patch)
tree92bb88000644e789020f4c2e1a6d6f72512a3964 /check-certificates
parent5beebbe8e89615836760c679aa01c79caa7db798 (diff)
check-certificates: try to fetch PEM and P12 file
Diffstat (limited to 'check-certificates')
-rw-r--r--check-certificates14
1 files 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 ];