RFR: 8371471: HttpClient: Log HTTP/3 handshake failures if logging errors is enabled [v4]

Daniel Jeliński djelinski at openjdk.org
Fri Nov 7 18:29:02 UTC 2025


On Fri, 7 Nov 2025 17:40:22 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Surprisingly if the QUIC handshake fails exceptionally, and `-Djdk.httpclient.HttpClient.log=errors` is specified, the exception is not logged. This change fixes that.
>
> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review feedback - request should fail

src/java.net.http/share/classes/jdk/internal/net/http/quic/QuicConnectionImpl.java line 597:

> 595:                     Log.logError("%s QUIC handshake failed: %s"
> 596:                             .formatted(logTag(), cause));
> 597:                     Log.logError(cause);

This produces 2 error messages like:

Nov 07, 2025 6:01:57 PM jdk.internal.net.http.quic.QuicConnectionImpl$HandshakeFlow failHandshakeCFs
INFO: ERROR: QuicServerConnection(1) QUIC handshake failed: java.io.IOException: Connection closed by client peer: CRYPTO_ERROR|certificate_unknown certificate_unknown
Nov 07, 2025 6:01:57 PM jdk.internal.net.http.quic.QuicConnectionImpl$HandshakeFlow failHandshakeCFs
INFO: ERROR: java.io.IOException: Connection closed by client peer: CRYPTO_ERROR|certificate_unknown certificate_unknown
java.io.IOException: Connection closed by client peer: CRYPTO_ERROR|certificate_unknown certificate_unknown
	at java.net.http/jdk.internal.net.http.quic.TerminationCause.toReportedCause(TerminationCause.java:129)

Can we remove the duplicate information? Currently there are 2 timestamps, and the exception message is printed 3 times.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28196#discussion_r2504917595


More information about the net-dev mailing list