You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usage of NettySslPackageAccessor presents some problems in environments where multiple ClassLoaders are in use.
Within an OSGi or JavaEE container, it's not unreasonable to expect that io.netty.handler.ssl.NettySslPackageAccessor and io.netty.handler.ssl.JdkSslContext will be loaded by different ClassLoaders (since they're located in separate JARs).
If this is the case, the attempt access package-private static field JdkSslContext.SUPPORTED_CIPHERS will fail with an IllegalAccessError since the package-private fields are 'scoped' at the ClassLoader level. Here's an example stack trace when this scenario plays out on JBoss WildFly:
java.lang.IllegalAccessError: tried to access field io.netty.handler.ssl.JdkSslContext.SUPPORTED_CIPHERS from class io.netty.handler.ssl.NettySslPackageAccessor
at io.netty.handler.ssl.NettySslPackageAccessor.jdkSupportedCipherSuites(NettySslPackageAccessor.java:24)
at org.asynchttpclient.config.AsyncHttpClientConfigDefaults.defaultEnabledCipherSuites(AsyncHttpClientConfigDefaults.java:85)
at org.asynchttpclient.DefaultAsyncHttpClientConfig$Builder.<init>(DefaultAsyncHttpClientConfig.java:635)
at org.asynchttpclient.DefaultAsyncHttpClient.<init>(DefaultAsyncHttpClient.java:67)
The text was updated successfully, but these errors were encountered:
I personally have no usage for OSGi nor JEE, so fixing this is not a priority for me, all the more as I'm pretty swamped.
If you want to get this fixed, I suggest you provide a PR to Netty to provide a public API for exposing the Ciphers they support (I guess they don't want to expose their internal mutable array). If you do so, I'll gladly integrate.
slandelle
changed the title
IllegalAccessError accessing field JdkSslContext.SUPPORTED_CIPHERS
IllegalAccessError accessing field JdkSslContext.SUPPORTED_CIPHERS when Netty and AHC sit in different ClassLoaders
Mar 30, 2017
Motivation:
* mess up with provided SslContext
* crash when netty and ahc are in different classloaders
Modifications:
* Drop NettySslPackageAccessor
* Revert to empty conf to use Netty default behavior (only Netty
recommended ciphers are available by default)
Result:
Don’t override provided SslContext behavior.
No more crash when netty and ahc sits in different classloaders
Usage of NettySslPackageAccessor presents some problems in environments where multiple ClassLoaders are in use.
Within an OSGi or JavaEE container, it's not unreasonable to expect that
io.netty.handler.ssl.NettySslPackageAccessor
andio.netty.handler.ssl.JdkSslContext
will be loaded by different ClassLoaders (since they're located in separate JARs).If this is the case, the attempt access package-private static field
JdkSslContext.SUPPORTED_CIPHERS
will fail with anIllegalAccessError
since the package-private fields are 'scoped' at theClassLoader
level. Here's an example stack trace when this scenario plays out on JBoss WildFly:The text was updated successfully, but these errors were encountered: