Replace Class.getClassLoader with io.netty.util.internal.PlatformDependent.getClassLoader in Openssl (#10454)
Motivation: Replace Class.getClassLoader with io.netty.util.internal.PlatformDependent.getClassLoader in Openssl so it also works when a SecurityManager is in place Modification: Replace Class.getClassLoader with io.netty.util.internal.PlatformDependent.getClassLoader in Openssl Result: No issues when a SecurityManager is in place
This commit is contained in:
parent
de4627852f
commit
70292f6823
@ -120,7 +120,8 @@ public final class OpenSsl {
|
||||
} else {
|
||||
// Test if netty-tcnative is in the classpath first.
|
||||
try {
|
||||
Class.forName("io.netty.internal.tcnative.SSLContext", false, OpenSsl.class.getClassLoader());
|
||||
Class.forName("io.netty.internal.tcnative.SSLContext", false,
|
||||
PlatformDependent.getClassLoader(OpenSsl.class));
|
||||
} catch (ClassNotFoundException t) {
|
||||
cause = t;
|
||||
logger.debug(
|
||||
@ -586,7 +587,7 @@ public final class OpenSsl {
|
||||
libNames.add(staticLibName + "_" + arch);
|
||||
libNames.add(staticLibName);
|
||||
|
||||
NativeLibraryLoader.loadFirstAvailable(SSLContext.class.getClassLoader(),
|
||||
NativeLibraryLoader.loadFirstAvailable(PlatformDependent.getClassLoader(SSLContext.class),
|
||||
libNames.toArray(new String[0]));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user