global-functions: $CertificateAvailable: try to use builtin certificates

The builtin certificates were introduced with RouterOS 7.19, so requires
this hacky :parse workaround.
This commit is contained in:
Christian Hesse 2025-05-28 15:08:26 +02:00
parent d59c4aee26
commit bf684a7197

View file

@ -119,6 +119,11 @@
:return false;
}
:if (([ /certificate/settings/get ]->"builtin-trust-anchors") = "trusted" && \
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CommonName . "\" ] ]") ]] > 0) do={
:return true;
}
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] = 0) do={
$LogPrint info $0 ("Certificate with CommonName '" . $CommonName . "' not available.");
:if ([ $CertificateDownload $CommonName ] = false) do={