global-functions: $CertificateNameByCN: pick the first match only

This commit is contained in:
Christian Hesse 2025-04-07 15:05:27 +02:00
parent c67f598dea
commit 7de9c64776

View file

@ -207,7 +207,7 @@
:global CleanName;
:local Cert [ /certificate/find where (common-name=$Match or fingerprint=$Match or name=$Match) ];
:local Cert ([ /certificate/find where (common-name=$Match or fingerprint=$Match or name=$Match) ]->0);
:local CommonName [ /certificate/get $Cert common-name ];
/certificate/set $Cert name=[ $CleanName $CommonName ];
}