diff options
author | Christian Hesse <mail@eworm.de> | 2024-09-26 15:24:05 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-09-26 15:24:05 +0200 |
commit | c2c72818de2cf35ea5b50eed3a505f86ed6be294 (patch) | |
tree | bf5071b3b0460cca9fe17fc9c35c099739d520a7 /global-functions.rsc | |
parent | 60aa553219b289e9d3e4ef7f0bb7db471f45af69 (diff) |
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.
Diffstat (limited to 'global-functions.rsc')
-rw-r--r-- | global-functions.rsc | 6 |
1 files changed, 6 insertions, 0 deletions
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 ]; } |