Skip to content

8381316: HttpClient / Http3: poor exception messages on SSL handshake errors#30563

Open
djelinski wants to merge 5 commits intoopenjdk:masterfrom
djelinski:quic-handshake-exceptions
Open

8381316: HttpClient / Http3: poor exception messages on SSL handshake errors#30563
djelinski wants to merge 5 commits intoopenjdk:masterfrom
djelinski:quic-handshake-exceptions

Conversation

@djelinski
Copy link
Copy Markdown
Member

@djelinski djelinski commented Apr 3, 2026

This PR improves the exceptions thrown from HttpClient.send when the QUIC TLS handshake fails on the client side, for example because the server certificate is not trusted.

Before the changes we would throw the following exception chain:

javax.net.ssl.SSLHandshakeException: QUIC connection establishment failed
Caused by: javax.net.ssl.SSLHandshakeException: QUIC connection establishment failed
Caused by: java.io.IOException: certificate_unknown

After the changes the following exception chain is thrown:

javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: javax.net.ssl.SSLHandshakeException: (certificate_unknown) PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The new exception chain matches the one observed with HTTP 1/2.

I updated a preexisting test to cover HTTP3, and added assertions to verify the exception message. HttpClient tests continue to pass.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8381316: HttpClient / Http3: poor exception messages on SSL handshake errors (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30563/head:pull/30563
$ git checkout pull/30563

Update a local copy of the PR:
$ git checkout pull/30563
$ git pull https://git.openjdk.org/jdk.git pull/30563/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30563

View PR using the GUI difftool:
$ git pr show -t 30563

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30563.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 3, 2026

👋 Welcome back djelinski! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 3, 2026

@djelinski This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8381316: HttpClient / Http3: poor exception messages on SSL handshake errors

Reviewed-by: dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 92 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot changed the title 8381316 8381316: HttpClient / Http3: poor exception messages on SSL handshake errors Apr 3, 2026
@openjdk openjdk bot added security security-dev@openjdk.org net net-dev@openjdk.org labels Apr 3, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 3, 2026

@djelinski The following labels will be automatically applied to this pull request:

  • net
  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 3, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 3, 2026

Webrevs

@djelinski
Copy link
Copy Markdown
Member Author

Thanks @dfuch for the review. Changes applied.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

net net-dev@openjdk.org ready Pull request is ready to be integrated rfr Pull request is ready for review security security-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

2 participants