]> git.kaiwu.me - haproxy.git/commit
REGTESTS: ssl: add verifyhost SAN vs CN matching test
authorWilliam Lallemand <wlallemand@irq6.net>
Tue, 1 Sep 2026 09:13:17 +0000 (09:13 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Sep 2026 11:47:07 +0000 (13:47 +0200)
commit62180d86176e5266c581fee2e6d66dfc797fef5f
tree6a0220f62f34a9941520d5dfd03703c640b29a9d
parent75129aaacb7a7b172f4e5334db71d6c1c50a3dbf
REGTESTS: ssl: add verifyhost SAN vs CN matching test

Add a VTC test to check that backend certificate verification in
ssl_sock_srv_verifycbk() adheres to RFC 6125:

1. A certificate with a matching SAN dNSName is accepted.
2. A legacy certificate without any SAN extension falls back to the
   Subject CN and is accepted.
3. A certificate with a non-matching SAN dNSName is rejected, even if
   its Subject CN matches the expected hostname.

The test uses dedicated static certificates in reg-tests/ssl/certs/
(verifyhost_ca.crt and associated leaf certificates) so that
certificates do not need to be generated at runtime.
reg-tests/ssl/certs/verifyhost_ca.crt [new file with mode: 0644]
reg-tests/ssl/certs/verifyhost_no_san.pem [new file with mode: 0644]
reg-tests/ssl/certs/verifyhost_san_match.pem [new file with mode: 0644]
reg-tests/ssl/certs/verifyhost_san_mismatch.pem [new file with mode: 0644]
reg-tests/ssl/verifyhost_san.vtc [new file with mode: 0644]