Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mtls-certificates: Fail on transport, not network level (wrong port) #42156

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

Karm
Copy link
Member

@Karm Karm commented Jul 26, 2024

fixes #40553

The test had been reporting a false negative in HotSpot mode by expecting ConnectException. That exception was not caused by a failed handshake, it was caused by the test trying to talk to the server on a wrong port.

In Native mode, the test framework had the port correct, so it talked to the server and got the correct SSLHandshakeException.

From JDK doc:

java.net.ConnectException
Signals that an error occurred while attempting to connect a socket to a remote address and port.
Typically, the connection was refused remotely (e. g., no process is listening on the remote address/ port).

javax.net.ssl.SSLHandshakeException
Indicates that the client and server could not negotiate the desired level of security.
The connection is no longer usable.

It makes no sense to test a connection refused error on a port nobody listens on. The correct test is to try to trigger a handshake exception while talking to the actual server.

@Karm Karm requested a review from sberyozkin July 26, 2024 07:46
@Karm Karm self-assigned this Jul 26, 2024
Copy link

quarkus-bot bot commented Jul 26, 2024

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@Karm Karm changed the title mtls-certificates: The test must fail on transport, not network level (wrong port) mtls-certificates: Fail on transport, not network level (wrong port) Jul 26, 2024

This comment has been minimized.

Copy link

quarkus-bot bot commented Jul 26, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit f0f76dc.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gsmet gsmet merged commit bcd1850 into quarkusio:main Aug 2, 2024
20 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mtls-certificates: CertificateRoleMappingTest fails in native
2 participants