diff options
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/global-functions b/global-functions index 9c58450..5f80c0b 100644 --- a/global-functions +++ b/global-functions @@ -116,6 +116,7 @@ :local CommonName [ :tostr $1 ]; :global CertificateDownload; + :global ParseKeyValueStore; :if ([ / system resource get free-hdd-space ] < 8388608 && \ [ / certificate settings get crl-download ] = true && \ @@ -127,6 +128,17 @@ :log info ("Certificate with CommonName \"" . $CommonName . "\" not available."); $CertificateDownload $CommonName; } + + :local CertVal [ / certificate get [ find where common-name=$CommonName ] ]; + :local Issuer ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN"); + :while ($Issuer != $CertVal->"common-name") do={ + :if ([ / certificate print count-only where common-name=$Issuer ] = 0) do={ + :log info ("Certificate chain for \"" . $CommonName . "\" is incomplete, missing \"" . $Issuer . "\"."); + $CertificateDownload $CommonName; + } + :set CertVal [ / certificate get [ find where common-name=$Issuer ] ]; + :set Issuer ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN"); + } } # send notification via e-mail |