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
10354b62c8
commit
9c5dbfd1b6
@ -119,7 +119,8 @@ public final class OpenSsl {
|
|||||||
} else {
|
} else {
|
||||||
// Test if netty-tcnative is in the classpath first.
|
// Test if netty-tcnative is in the classpath first.
|
||||||
try {
|
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) {
|
} catch (ClassNotFoundException t) {
|
||||||
cause = t;
|
cause = t;
|
||||||
logger.debug(
|
logger.debug(
|
||||||
@ -556,7 +557,7 @@ public final class OpenSsl {
|
|||||||
libNames.add(staticLibName + "_" + arch);
|
libNames.add(staticLibName + "_" + arch);
|
||||||
libNames.add(staticLibName);
|
libNames.add(staticLibName);
|
||||||
|
|
||||||
NativeLibraryLoader.loadFirstAvailable(SSLContext.class.getClassLoader(),
|
NativeLibraryLoader.loadFirstAvailable(PlatformDependent.getClassLoader(SSLContext.class),
|
||||||
libNames.toArray(new String[0]));
|
libNames.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user