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

This commit is contained in:
Christian Hesse 2025-04-07 15:05:27 +02:00
parent e36613608c
commit 44fa91f5c4

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