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

Bradford Wetmore wetmore at openjdk.org
Tue Feb 4 19:42:25 UTC 2025


On Tue, 4 Feb 2025 17:18:09 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Bradford Wetmore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Codereview Comments
>
> 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)`?

I had a similar thought over the weekend.  

Updated the comment to `Preserve network byte order by using ISO_8859_1 encoding`.  

> As far as I understand what you are trying to do...

Yes.  The API was String[] (implemented with 7-bit ASCII), but it was pointed out that we didn't have any way to send some of the TLS GREASE ([RFC 8701](https://www.rfc-editor.org/rfc/rfc8701.html)) values or use extended ASCII (8-bit) characters.  (International Charsets was a bonus, but likely aren't used for ALPN.)  This was a reasonable workaround.

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

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


More information about the net-dev mailing list