janjust wrotehow would you want to check the serial number?
if the certificate is accepted by OpenVPN then it was signed by a CA cert that OpenVPN trusts - that should be enough.
If you want match against a list of allowed serial numbers then make a list of serial numbers and match ${tls_serial_{n}} against it.
I have get environment variable tls_serial_{0} by type "echo %tls_serial_{0}%" on cmd of Windows, and result is serial number of client's certificate.
I have write a program tls-verify with C and put it into server config :" tls-verify "'C:\\OpenVPNSerialCheck.exe' 123123123", with 123123123 is serial number of client's certificate, and it failed. When i see server.log, message failed is "[ERROR]: Could not find environment variable tls_serial_{0}!"
Please help me, it's best if you can give me a example about it. Thanks.