Allow the provider position to be read from the system.
This commit is contained in:
Timothy Bish 2016-05-06 09:37:51 -04:00
parent 1de7e7e8a3
commit 5009b0c03b
1 changed files with 2 additions and 1 deletions

View File

@ -273,7 +273,8 @@ public class BrokerService implements Service {
ClassLoader loader = BrokerService.class.getClassLoader();
Class<?> clazz = loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider");
Provider bouncycastle = (Provider) clazz.newInstance();
Security.insertProviderAt(bouncycastle, 2);
Security.insertProviderAt(bouncycastle,
Integer.getInteger("org.apache.activemq.broker.BouncyCastlePosition", 2));
LOG.info("Loaded the Bouncy Castle security provider.");
} catch(Throwable e) {
// No BouncyCastle found so we use the default Java Security Provider