mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 09:44:30 +02:00
global-functions: $CertificateDownload: add another check...
... that the certificate is really available. Turns out that mkcert.org ships certificates where OU or whatever matches - that's not what we want.
This commit is contained in:
parent
60aa553219
commit
c2c72818de
1 changed files with 6 additions and 0 deletions
|
@ -176,6 +176,12 @@
|
|||
:delay 1s;
|
||||
/file/remove [ find where name=$FileName ];
|
||||
|
||||
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] = 0) do={
|
||||
/certificate/remove [ find where name~("^" . $FileName . "_[0-9]+\$") ];
|
||||
$LogPrint warning $0 ("Certificate with CommonName '" . $CommonName . "' still unavailable!");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Cert in=[ /certificate/find where name~("^" . $FileName . "_[0-9]+\$") ] do={
|
||||
$CertificateNameByCN [ /certificate/get $Cert common-name ];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue