You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
verify_certificate_identity relies on a naive string-based approach to extract DNS: (and IP:) entries from the subjectAltName extension. However, the SAN is truly an ASN.1 structure, and when the library stringifies it, otherName entries and semicolons (or other delimiters) will appear in the output. This leads to the regex split call misreading the line, causing verify_certificate_identity to fail on certificates that include otherName (common in Active Directory environments, for example).
and decided the custom approach was still needed???
yes, unfortunately the ASN.1 parsing isn't 100% complete and there are differences in how the ext.value is presented. there were changes (fixes) to ASN.1 since but still brittle IMO.
changes (e.g. "Same here. san.value is changed to san.value.last.value") in your PR is risky to be put in. those changes would require more tests.
verify_certificate_identity
relies on a naive string-based approach to extractDNS:
(andIP:
) entries from the subjectAltName extension. However, the SAN is truly an ASN.1 structure, and when the library stringifies it,otherName
entries and semicolons (or other delimiters) will appear in the output. This leads to the regexsplit
call misreading the line, causingverify_certificate_identity
to fail on certificates that includeotherName
(common in Active Directory environments, for example).For instance, a SAN might be stringified like:
(See
jruby-openssl/src/main/java/org/jruby/ext/openssl/X509Extension.java
Line 518 in 976a3f5
When
split(/,\s+/)
is applied to this string (see https://github.com/jruby/jruby-openssl/blob/976a3f5152b36129ad478175473bd63345286450/lib/openssl/ssl.rb#L273C9-L273C32), the returned array isThe
DNS:host1.example.com
entry will not be found and extracted by the regex inif /\ADNS:(.*)/
(https://github.com/jruby/jruby-openssl/blob/976a3f5152b36129ad478175473bd63345286450/lib/openssl/ssl.rb#L277C11-L277C26)The text was updated successfully, but these errors were encountered: