mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $CertificateAvailable: use pre-test loop
This is required to test for root CA (without intermediate) directly.
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
}
|
||||
|
||||
:local CertVal [ / certificate get [ find where common-name=$CommonName ] ];
|
||||
:do {
|
||||
:while (($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")) do={
|
||||
:if ([ :len [ / certificate find where skid=($CertVal->"akid") ] ] = 0) do={
|
||||
$LogPrintExit2 info $0 ("Certificate chain for \"" . $CommonName . \
|
||||
"\" is incomplete, missing \"" . ([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN") . "\".") false;
|
||||
@@ -93,7 +93,7 @@
|
||||
}
|
||||
}
|
||||
:set CertVal [ / certificate get [ find where skid=($CertVal->"akid") ] ];
|
||||
} while=(($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid"));
|
||||
}
|
||||
:return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user