Commit e562825b authored by Christian Hesse's avatar Christian Hesse

check-certificates: try to fetch PEM and P12 file

parent 5beebbe8
......@@ -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 ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment