mirror of https://github.com/apache/activemq.git
AMQ-9431: Add org.apache.activemq.broker.BouncyCastleNotAdded system property to not load BouncyCastle in BrokerService
(cherry picked from commit 0a90f323ce
)
This commit is contained in:
parent
0e7c607758
commit
012cac88dc
|
@ -271,6 +271,8 @@ public class BrokerService implements Service {
|
|||
static {
|
||||
|
||||
try {
|
||||
Boolean bouncyCastleNotAdded = Boolean.getBoolean("org.apache.activemq.broker.BouncyCastleNotAdded");
|
||||
if (bouncyCastleNotAdded == null || bouncyCastleNotAdded == false) {
|
||||
ClassLoader loader = BrokerService.class.getClassLoader();
|
||||
Class<?> clazz = loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider");
|
||||
Provider bouncycastle = (Provider) clazz.getDeclaredConstructor().newInstance();
|
||||
|
@ -282,6 +284,7 @@ public class BrokerService implements Service {
|
|||
ret = Security.addProvider(bouncycastle);
|
||||
}
|
||||
LOG.info("Loaded the Bouncy Castle security provider at position: {}", ret);
|
||||
}
|
||||
} catch(Throwable e) {
|
||||
// No BouncyCastle found so we use the default Java Security Provider
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue