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

[8.x][Entitlements] Fix AbstractDelegateHttpsURLConnection "this" parameter type (#124304) #124325

Conversation

ldematte
Copy link
Contributor

@ldematte ldematte commented Mar 7, 2025

Backport of #124304

…r type (elastic#124304)

Our check methods injected by the instrumenter receive "this" as the second parameter.
For internal classes like AbstractDelegateHttpsURLConnection we generally use a base type; in this case we were using javax.net.ssl.HttpsURLConnection, which is incorrect as AbstractDelegateHttpsURLConnection derives from java.net.HttpURLConnection.
This was not failing in our tests because we don't actually use that parameter in that check function.

Also, it was not failing on transform, just on retransformClasses, and only in JDK 24. Apparently, JDK 24 introduced new validation there (to be confirmed).

And it was failing just on cloud as the APM agent there (which is loaded before our agent) connects to a https endpoint - our IT tests, and ./gradlew run --with-apm-server, use a http endpoint. Using https makes the JVM load AbstractDelegateHttpsURLConnection, making it one of the classes we need to retransform, triggering the VerifyError.
@ldematte ldematte added backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v8.19.0 :Core/Infra/Entitlements Entitlements infrastructure labels Mar 7, 2025
@elasticsearchmachine elasticsearchmachine merged commit 05a9ffe into elastic:8.x Mar 7, 2025
15 checks passed
@ldematte ldematte deleted the backport/8.x/entitlements/fix-abstractdelegateurlconnection-signature branch March 7, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :Core/Infra/Entitlements Entitlements infrastructure v8.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants