check-certificates: try to fetch PEM and P12 file

This commit is contained in:
Christian Hesse 2019-04-10 14:15:41 +02:00
parent 5beebbe8e8
commit e562825bd9

View file

@ -34,11 +34,17 @@
:error "No CertRenewUrl given."; :error "No CertRenewUrl given.";
} }
/ tool fetch check-certificate=yes-without-crl ($CertRenewUrl . $CommonName . ".pem"); :foreach Type in={ ".pem"; ".p12" } do={
:foreach PassPhrase in=$CertRenewPass do={ :do {
/ certificate import file-name=($CommonName . ".pem") passphrase=$PassPhrase; / 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 CertNew [ / certificate find where common-name=$CommonName fingerprint!=$FingerPrint expires-after>3w ];
:local CertNameNew [ / certificate get $CertNew name ]; :local CertNameNew [ / certificate get $CertNew name ];