-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
JDK 17 (JEP 403 Strongly Encapsulate JDK Internals) breaks okhttp without additional config #6694
Comments
Looks like a clean fix is to log and swallow this exception
|
We should add a JDK17 CI build at the same time. |
Thanks for the great report! |
@sureshg Something is off with the java files and line numbers in your stacktrace. Can you easily test if we give you a snapshot? |
Between Gradle, OpenJDK and Github Actions, testing this in a PR isn't much fun. |
@yschimke My bad, yes you are correct. The issue is due to an old OKHttp dependency used in the Gradle plugin. I did test the latest OKHttp release on JDK 18 and it's running smoothly without any issues/warnings 👍🏼 . Again, really sorry for the inconvenience caused. |
The only place i could find where |
Fix for 4.9.x #6742 (draft currently) |
I don't think it's trivial to test for this, as I suspect that the Gradle 7.2 + Junit code needs to avoid this anyway.
Is passing even if I disable the fix. |
Throws the following error when trying to create an OkHttpClient on JDK17-ea build with strong encapsulation enabled.
Have to explicitly open this package for reflection in all (
--add-opens java.base/sun.security.ssl=ALL-UNNAMED
) the programs for okhttp to work properly.Source: https://github.com/square/okhttp/blob/master/okhttp/src/main/kotlin/okhttp3/internal/platform/Platform.kt#L93
The text was updated successfully, but these errors were encountered: