Version: OpenVPN 2.6.14 (deb13u1)
OS: Debian Trixie (raspberry pi OS)
Expected behavior:
This option in the server.conf
verify-x509-name "C=A, ST=B, L=C, O=D, OU=E" name-prefix
should match any certificate whose subject STARTS with this string.
The intention is that the server only accepts certificates with certain values in certain fields that are the same across all client-certificates.
Since CN and emailAddress are different in the client certs, I need to match only the fields that are identical.
Actual behavior:
Full subject match is performed. Certificates with additional fields (CN, emailAddress) are rejected.
Log output:
VERIFY X509NAME ERROR: C=A, ST=B, L=C, O=D, OU=E, CN=F, emailAddress=G,
must be C=A, ST=B, L=C, O=D, OU=E
Increasing verb to 6 showed that the server is using this:
verify_x509_type = 3 (expected: 2 for name-prefix?)
Steps to reproduce:
- Create CA with EASYRSA_DN "org"
- Issue server/client certs with O, OU, CN, email fields
- Set verify-x509-name with name-prefix on server
- Connect with client -> VERIFY X509NAME ERROR