Repository navigation
HADOOP-19997. TestSSLHttpServerMTLS.testUntrustedClientIsRejected fails intermittently with SocketException instead of SSLHandshakeException - #8780
Closed
joseluisll wants to merge 1 commit into
Conversation
…ls intermittently with SocketException instead of SSLHandshakeException. The server rejects the untrusted client certificate and drops the connection at once, racing the client's last handshake flight. How the refusal reaches the client depends on who wins and on the TLS version: SSLHandshakeException under TLSv1.2, SocketException when the close wins, and a bare IOException on the request write under TLSv1.3. Assert that getResponseCode() fails below HTTP with anything but a ConnectException, rather than which exception carries the refusal. Split out of HADOOP-19979. Contains content generated by Claude Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
💔 -1 overall
This message was automatically generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
https://issues.apache.org/jira/browse/HADOOP-19997
testUntrustedClientIsRejectedexpects anSSLHandshakeException. When the server rejects the client certificate, it closes the connection while the client is still sending its last handshake message. Depending on timing and TLS version, the client sees anSSLHandshakeException, aSocketException, or a plainIOException. The test only accepts the first, so it fails intermittently.The test now checks that the request is refused, whatever the exception:
getResponseCode()must throw anIOException. It returns HTTP error codes instead of throwing, so a 403 or 500 would still fail the test.ConnectException, which would mean the server was never reached.Test-only change, one file.
How was this patch tested?
OpenJDK 21, 50 runs each:
SocketException)SocketException)TestSSLHttpServerMTLSpasses undermvn test. Checkstyle is clean.For code changes:
declared according to the connector-specific documentation? (N/A)
LICENSE,LICENSE-binary,NOTICE-binaryfiles? (N/A)AI Tooling
If an AI tool was used:
where is the name of the AI tool used.
https://www.apache.org/legal/generative-tooling.html
Contains content generated by Claude Code.