Skip to content

Commit

Permalink
W-16889209 | merge changes
Browse files Browse the repository at this point in the history
W-16889209 | reset classloader
  • Loading branch information
sorin-sv-mulesoft committed Jan 29, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ec26e94 commit a5aa5d7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -268,10 +268,10 @@ private boolean shouldUseSsl() {
}

protected void configureSSLContext() {
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
try {
if (tlsConfiguration != null) {
SSLContext sslContext = tlsConfiguration.createSslContext();
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
// force loading of class from connector instead of the one from the library, because it uses reflection
ClassLoader firewallLoader = new FirewallLoader(currentClassLoader);
ClassLoader loader = new URLClassLoader(new URL[]{this.getClass().getProtectionDomain().getCodeSource().getLocation()}, firewallLoader);
@@ -285,6 +285,8 @@ protected void configureSSLContext() {
} catch (KeyManagementException | NoSuchAlgorithmException | InvocationTargetException | IllegalAccessException
| NoSuchMethodException e) {
throw new JmsExtensionException("A problem occurred trying to configure SSL Options on ActiveMQ Connection", e);
} finally {
Thread.currentThread().setContextClassLoader(currentClassLoader);
}
}

0 comments on commit a5aa5d7

Please sign in to comment.