On Fri, 27 Mar 2026 06:56:17 GMT, Jaikiran Pai <[email protected]> wrote:

> Can I please get a review of this change which proposes to address the issue 
> noted in https://bugs.openjdk.org/browse/JDK-8373778?
> 
> When a CONNECT request to a proxy returns an invalid status line, then the 
> current code in the internal implementation of `HttpURLConnection` runs into 
> an exception trying to parse that status line. That exception propagates as 
> an unspecified `java.util.NoSuchElementException` to the application.
> 
> The commit in this PR addresses it by doing additional checks on the status 
> line to ensure it is valid and if it isn't then it raises an `IOException`. 
> This is the same `IOException` that would have been raised for a few other 
> invalid responses for a CONNECT request.
> 
> A new jtreg test has been introduced to reproduce the issue and verify the 
> fix. tier1, tier2, tier3 testing succeeded with this change.

This pull request has now been integrated.

Changeset: f40a359d
Author:    Jaikiran Pai <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/f40a359df36edef8df5a72e3c072967924636264
Stats:     306 lines in 2 files changed: 303 ins; 0 del; 3 mod

8373778: java.util.NoSuchElementException in HttpURLConnection.doTunneling0 
when connecting via HTTPS

Reviewed-by: michaelm, vyazici

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

PR: https://git.openjdk.org/jdk/pull/30466

Reply via email to