Skip to content

Adding SSL configuration through RabbitConnectionFactoryBean approach into the documentation #2472

Closed
@artembilan

Description

@artembilan

Discussed in #2471

Originally posted by kstojanovski-novatec June 2, 2023
I was searching for a way, how to add the SSL properties path programmatically, and after a long search ended up creating RabbitConnectionFactoryBean.
i.e.

//    Possible solution for TLS / SSL
RabbitConnectionFactoryBean rabbitConnectionFactoryBean = new RabbitConnectionFactoryBean();
rabbitConnectionFactoryBean.setUseSSL(true);
//    file where the SSL properties are described in
//    https://docs.spring.io/spring-amqp/reference/html/#rabbitconnectionfactorybean-configuring-ssl
//    keyStore, trustStore, keyStore.passPhrase, trustStore.passPhrase
rabbitConnectionFactoryBean.setSslPropertiesLocation(new ClassPathResource("ssl.properties"));
CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(rabbitConnectionFactoryBean.getRabbitConnectionFactory());

Is this the correct way of doing this? And if yes, can this kind of code be a part of the documentation?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions