global-functions: $CertificateNameByCN: warn with no match

This commit is contained in:
Christian Hesse 2025-04-10 11:07:59 +02:00
parent c823ff87ed
commit d4b5e1f5e7

View file

@ -206,9 +206,11 @@
:local Match [ :tostr $1 ];
:global CleanName;
:global LogPrint;
:local Cert ([ /certificate/find where (common-name=$Match or fingerprint=$Match or name=$Match) ]->0);
:if ([ :len $Cert ] = 0) do={
$LogPrint warning $0 ("No matching certificate found.");
:return false;
}
:local CommonName [ /certificate/get $Cert common-name ];