Skip to content

Commit 717d700

Browse files
committed
Skip optional wildcard SAN tests on LibreSSL 3.5.0+
RFC 6066 states how some wildcard SAN entries MAY be handled, but it does not say they MUST be handled. LibreSSL 3.5.0 only handles suffix wildcard SANs, not prefix wildcard SANs, or interior wildcard SANs, so return early from the wildcard SAN tests on LibreSSL 3.5.0. Fixes #471
1 parent bff4080 commit 717d700

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/openssl/test_ssl.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,16 @@ def test_post_connection_check_wildcard_san
676676
# buzz.example.net, respectively). ...
677677
assert_equal(true, OpenSSL::SSL.verify_certificate_identity(
678678
create_cert_with_san('DNS:baz*.example.com'), 'baz1.example.com'))
679+
680+
# LibreSSL 3.5.0+ doesn't support other wildcard certificates
681+
# (it isn't required to, as RFC states MAY, not MUST)
682+
return if libressl?(3, 5, 0)
683+
679684
assert_equal(true, OpenSSL::SSL.verify_certificate_identity(
680685
create_cert_with_san('DNS:*baz.example.com'), 'foobaz.example.com'))
681686
assert_equal(true, OpenSSL::SSL.verify_certificate_identity(
682687
create_cert_with_san('DNS:b*z.example.com'), 'buzz.example.com'))
688+
683689
# Section 6.4.3 of RFC6125 states that client should NOT match identifier
684690
# where wildcard is other than left-most label.
685691
#

0 commit comments

Comments
 (0)