mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-16 22:19:32 +00:00
check-certificates: handle builtin certificate in chain
This includes an ugly workaround to keep it compatible with old RouterOS versions... For now.
This commit is contained in:
parent
54af7fd024
commit
5481787869
1 changed files with 6 additions and 0 deletions
|
|
@ -117,6 +117,12 @@
|
||||||
:local Return "";
|
:local Return "";
|
||||||
:for I from=0 to=5 do={
|
:for I from=0 to=5 do={
|
||||||
:set Return ($Return . [ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
|
:set Return ($Return . [ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
|
||||||
|
:local CertSettings [ /certificate/settings/get ];
|
||||||
|
:if (([ :len ($CertSettings->"builtin-trust-anchors") ] > 0 || \
|
||||||
|
[ :len ($CertSettings->"builtin-trust-store") ] > 0) && \
|
||||||
|
[[ :parse (":return [ :len [ /certificate/builtin/find where skid=\"" . ($CertVal->"akid") . "\" ] ]") ]] > 0) do={
|
||||||
|
:return $Return;
|
||||||
|
}
|
||||||
:set CertVal [ /certificate/get [ find where skid=($CertVal->"akid") ] ];
|
:set CertVal [ /certificate/get [ find where skid=($CertVal->"akid") ] ];
|
||||||
:if (($CertVal->"akid") = "" || ($CertVal->"akid") = ($CertVal->"skid")) do={
|
:if (($CertVal->"akid") = "" || ($CertVal->"akid") = ($CertVal->"skid")) do={
|
||||||
:return $Return;
|
:return $Return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue