global-functions: $CertificateAvailable: get missing certificate...

... not the issued and available one.
This commit is contained in:
Christian Hesse 2026-01-16 00:00:58 +01:00
parent ad455c8f1d
commit d673f0956c

View file

@ -150,9 +150,9 @@
:local CertVal [ /certificate/get [ find where common-name=$CommonName ] ]; :local CertVal [ /certificate/get [ find where common-name=$CommonName ] ];
:while (($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")) do={ :while (($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")) do={
:if ([ :len [ /certificate/find where skid=($CertVal->"akid") ] ] = 0) do={ :if ([ :len [ /certificate/find where skid=($CertVal->"akid") ] ] = 0) do={
$LogPrint info $0 ("Certificate chain for '" . $CommonName . \ :local IssuerCN ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
"' is incomplete, missing '" . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") . "'."); $LogPrint info $0 ("Certificate chain for '" . $CommonName . "' is incomplete, missing '" . $IssuerCN . "'.");
:if ([ $CertificateDownload $CommonName ] = false) do={ :if ([ $CertificateDownload $IssuerCN ] = false) do={
:return false; :return false;
} }
} }