On Wed, 6 May 2026 09:52:27 GMT, Volkan Yazici <[email protected]> wrote:

>> src/java.base/share/classes/javax/net/ssl/SNIHostName.java line 81:
>> 
>>> 79:      * Creates an {@code SNIHostName} using the specified hostname.
>>> 80:      * <p>
>>> 81:      * A valid SNI hostname is a DNS hostname, which is either an 
>>> ASCII-encoded
>> 
>> I wonder if "DNS hostname" could link to somewhere authoritative that 
>> defines a DNS hostname. If you could find a suitable target then the first 
>> usage in the class description could link to it.
>
> I had the very same thought while writing the docs, but had difficulty in 
> implementing it. Initially, I've thought of referencing to 
> `sun.security.x509.DNSName`. But it is neither well-documented, nor public. I 
> can suggest two candidates:
> 
> 1. [RFC 1123 "Requirements for Internet Hosts -- Application and Support" > 
> 2.1 Host Names and 
> Numbers](https://www.rfc-editor.org/rfc/rfc1123.html#page-13). — It is 
> already referenced in `@spec`, it amends [RFC 952 "DOD INTERNET HOST TABLE 
> SPECIFICATION"](https://www.rfc-editor.org/rfc/rfc952.html), and it contains 
> a "good enough" definition.
> 2. [RFC 5280 "Internet X.509 Public Key Infrastructure Certificate and 
> Certificate Revocation List (CRL) Profile" > 4.2.1.6. Subject Alternative 
> Name](https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.6) — AFAICT, 
> this is _"the authoritative definition"_, but it has never been mentioned 
> earlier in `SNIHostName` or `SNIServerName`.
> 
> @artur-oracle, @AlanBateman, do you have a certain preference? Shall I simply 
> use RFC 1123?

Both RFC 5280 and RFC 1123 are referenced in `sun.security.x509.DNSName` 
class-level javadoc, so we can do the same here. There are multiple RFCs 
actually that define/amend the DNS format, but I think we can just mention 
these two.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30747#discussion_r3196422179

Reply via email to