check-certificates: check and download certificate chain

This commit is contained in:
Christian Hesse 2020-04-03 14:12:09 +02:00
parent afd33b8e25
commit c1c8d46dc0

View file

@ -9,6 +9,7 @@
:global CertRenewUrl; :global CertRenewUrl;
:global Identity; :global Identity;
:global CertificateAvailable
:global CertificateNameByCN; :global CertificateNameByCN;
:global LogPrintExit; :global LogPrintExit;
:global ParseKeyValueStore; :global ParseKeyValueStore;
@ -56,6 +57,8 @@
:local CertNew [ / certificate find where common-name=($CertVal->"common-name") fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>3w ]; :local CertNew [ / certificate find where common-name=($CertVal->"common-name") fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>3w ];
:local CertNewVal [ / certificate get $CertNew ]; :local CertNewVal [ / certificate get $CertNew ];
$CertificateAvailable ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN");
:if ($Cert != $CertNew) do={ :if ($Cert != $CertNew) do={
$LogPrintExit debug ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.") false; $LogPrintExit debug ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.") false;