micronaut-rabbitmq icon indicating copy to clipboard operation
micronaut-rabbitmq copied to clipboard

Docs: Clarify how to use amqps connections

Open davemaul opened this issue 3 years ago • 1 comments

Hello there,

i had a headache trying to create an SSL connection for RabbitMQ. Correct me if I'm wrong, but I think the smoothest way to achieve this is by using rabbitmq.uri: amqps://rabbitmq:5671 instead of a combination of rabbitmq.host: rabbitmq and rabbitmq.port: 5671 because in the latter case SSL will be disabled. Furthermore, there's no property to explicitely activate SSL. Spring offers something like that:

spring.rabbitmq.ssl.enabled: true
spring.rabbitmq.ssl.validate-server-certificate: true
spring.rabbitmq.ssl.verify-hostname: true

I only found out how to configure SSL by looking into com.rabbitmq.client.ConnectionFactory:

image

In the docs there's nothing explicit about SSL connections. Imo this would be very useful especially for production usage.

Thanks in advance!

davemaul avatar Jul 15 '21 08:07 davemaul

I am also wondering how to set this up. The setUri approach is not good as it uses useSslProtocol() which is not suitable for production

Convenience method for configuring TLS using the default set of TLS protocols and a trusting TrustManager. This setup is only suitable for development and QA environments. The trust manager will trust every server certificate presented to it, this is convenient for local development but not recommended to use in production as it provides no protection against man-in-the-middle attacks. Prefer useSslProtocol(SSLContext).

jmongard avatar Oct 24 '23 10:10 jmongard