RFR: 8349121: SSLParameters.setApplicationProtocols() ALPN example could be clarified

Daniel Fuchs dfuchs at openjdk.org
Tue Feb 4 17:21:12 UTC 2025


On Fri, 31 Jan 2025 01:45:47 GMT, Bradford Wetmore <wetmore at openjdk.org> wrote:

> Update and clarify the sample code.
> 
> Docs only, no additional testing other than verifying javadoc is correctly output.

src/java.base/share/classes/javax/net/ssl/SSLParameters.java line 668:

> 666:      *     String encodedHukUnI =
> 667:      *         new String(bytes, StandardCharsets.ISO_8859_1);
> 668:      *

Maybe a better comment here would be:

    *      // Preserve bytes by using ISO_8859_1 encoding

because we're not converting anything into anything. 

As far as I understand what you are trying to do is to shoe-horn a byte array into a string, so that you can retrieve the original array using `String.getBytes(StandardCharsets.ISO_8859_1)`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23379#discussion_r1941585321


More information about the security-dev mailing list