micronaut-projects / micronaut-rabbitmq

Micronaut extensions to easily publish and consume messages with RabbitMQ
Apache License 2.0
18 stars 20 forks source link

Docs: Clarify how to use amqps connections #253

Open davemaul opened 2 years ago

davemaul commented 2 years ago

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!

jmongard commented 8 months ago

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).