spring-boot
spring-boot copied to clipboard
Provide configuration properties for configuring an ActiveMQ connection factory that uses SSL
Springboot has no place to configure SSL related parameters and certificates for Activemq,Springboot activemq supports SSL connections by default?
There's no property based support for configuring a connection factory that uses SSL with a custom keystore or custom truststore. You can, however, provide your own ActiveMQSslConnectionFactory bean and keep the rest of the auto-configuration.
I've opened #17589 for us to consider more broadly how we should support SSL.
We need to override the default connection to ActiveMQ using ActiveMQSslConnectionFactory bean with your own configuration properties :
@Bean
public ActiveMQSslConnectionFactory activeMQSslConnectionFactory(
@Value("${spring.activemq.broker-url}") String brokerUrl,
@Value("${spring.activemq.ssl.trustStorePath}") String trustStorePath,
@Value("${spring.activemq.ssl.trustStorePass}") String trustStorePass,
@Value("${spring.activemq.ssl.keyStorePath}") String keyStorePath,
@Value("${spring.activemq.ssl.keyStorePass}") String keyStorePass) throws Exception {
ActiveMQSslConnectionFactory factory = new ActiveMQSslConnectionFactory(brokerUrl);
factory.setTrustStore(trustStorePath);
factory.setTrustStorePassword(trustStorePass);
factory.setKeyStore(keyStorePath);
factory.setKeyStorePassword(keyStorePass);
return factory;
}
Blocked by #34011