On Fri, 17 Apr 2026 18:23:50 GMT, Artur Barashev <[email protected]> wrote:
>> src/java.base/share/classes/sun/security/x509/DNSName.java line 117:
>>
>>> 115: }
>>> 116:
>>> 117: if (label.startsWith("*")) {
>>
>> Maybe we just check `label.equals("*")`? It can always be detected later at
>> the `DNS_ALLOWED.indexOf(c) < 0` check.
>
> Yes, we can. One detail about it: the original code throws a separate
> exception for this case mentioning a wildcard, so we also throw an exception
> with a wildcard-specific message in the new code. Not sure how important it
> would be in practice though.
I cannot see why `*x` and `x*` should throw different exceptions.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30628#discussion_r3102766917