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:
Christian Hesse 2024-09-26 15:24:05 +02:00
parent 60aa553219
commit c2c72818de

View file

@ -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 ];
}