From c2c72818de2cf35ea5b50eed3a505f86ed6be294 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 26 Sep 2024 15:24:05 +0200 Subject: 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. --- global-functions.rsc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 9ee5312..e5471dd 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -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 ]; } -- cgit v1.2.3-70-g09d2