On Tue, 25 Nov 2025 10:46:34 GMT, Daniel Jeliński <[email protected]> wrote:

>> When checking for supported TLS versions, use SSLContext default parameters 
>> if the provided SSLParameters have no protocols configured.
>> 
>> This fixes an issue where using SSLParameters with no protocols disabled the 
>> use of HTTP2 and HTTP3, even when these protocols were supported and enabled 
>> in the SSLContext.
>> 
>> Modified the existing tests to additionally cover the case of empty 
>> SSLParameters. All tests continue to pass.
>
> Daniel Jeliński has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - Cleanup HttpClientImpl ctor
>  - Rename setParams

src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java line 
480:

> 478:         hasRequiredH3TLS = 
> Arrays.asList(sslProtocols).contains("TLSv1.3");
> 479:         // HTTP/2 MUST use TLS version 1.2 or higher for HTTP/2 over TLS
> 480:         hasRequiredH2TLS = hasRequiredH3TLS || 
> Arrays.asList(sslProtocols).contains("TLSv1.2");

Hello Daniel, I think if a `HttpClient` is configured with `sslParameters(new 
SSLParameters())`, then even with this new change in this PR, where we default 
the `sslProtocols` here to `new String[0]`, `hasRequiredH2TLS` would continue 
to return `false` right? Thus H2 is still disabled?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28480#discussion_r2559575404

Reply via email to