setCommonBrokerSSLProperties(needClientAuth, Collections.singleton(TestBrokerConfiguration.ENTRY_NAME_SSL_TRUSTSTORE));
}
private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames) throws ConfigurationException
{
TestBrokerConfiguration config = getBrokerConfiguration();
Map<String, Object> sslPortAttributes = new HashMap<String, Object>();
sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
sslPortAttributes.put(Port.NEED_CLIENT_AUTH, String.valueOf(needClientAuth));
sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
sslPortAttributes.put(Port.TRUST_STORES, trustStoreNames);
config.addPortConfiguration(sslPortAttributes);
Map<String, Object> externalAuthProviderAttributes = new HashMap<String, Object>();
externalAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
externalAuthProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManagerFactory.PROVIDER_TYPE);
config.addAuthenticationProviderConfiguration(externalAuthProviderAttributes);
config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
}