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

[MRESOLVER-579] Fix overwrite of SSLParameters in JDK HTTP transport when securityMode is "insecure" #529

Merged

Conversation

scholzi100
Copy link
Contributor

@scholzi100 scholzi100 commented Jul 8, 2024

I have been experimenting with Maven 4.0.0-beta-3, specifically testing its HTTP/2 support. During my tests, I used a self-signed certificate for the testing repository and disabled TLS validation. This approach produced unexpected behavior. While TLS certificate validation was indeed disabled as expected, it also caused the ALPN extension to be omitted from the Client Hello message.

To further investigate, I added the self-signed certificate to the JDK's cacerts keystore and removed the insecure option. With this configuration, ALPN support was restored, and HTTP/2 worked correctly again. This behavior can lead to problems if the server prioritizes HTTP/2 or does not support HTTP/1.1.

This change addresses an issue where SSLParameters were being overwritten (introduced in 08f102a), causing the loss of multiple TLS extensions, including ALPN and SNI. Setting the aether.transport.https.securityMode=insecure property disables TLS validation but also inadvertently disabled ALPN and SNI.

Now, SSLParameters are derived from SSLContext defaults to ensure proper handling of these extensions, even when TLS validation is disabled in JDK HTTP transport.

TODOs:

  • Add test coverage

https://issues.apache.org/jira/browse/MRESOLVER-579

…e is "insecure"

This change addresses an issue where SSLParameters were being overwritten, causing the loss of multiple TLS extensions, including ALPN and SNI. Setting the `aether.transport.https.securityMode=insecure` property disables TLS validation but also inadvertently disabled ALPN and SNI.

SSLParameters are now derived from SSLContext defaults to ensure proper handling of these extensions, even when TLS validation is disabled in JDK HTTP transport.
@cstamas cstamas added this to the 2.0.1 milestone Jul 8, 2024
@cstamas cstamas changed the title Fix overwrite of SSLParameters in JDK HTTP transport when securityMode is "insecure" [MRESOLVER-579] Fix overwrite of SSLParameters in JDK HTTP transport when securityMode is "insecure" Jul 9, 2024
@cstamas
Copy link
Member

cstamas commented Jul 9, 2024

TODO is here #530

@cstamas cstamas merged commit 3927899 into apache:master Jul 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants