Configure RabbitMQ to use the certificate and key

XRAY: Enabling and configuring TLS connection for RabbitMQ in Linux

AuthorFullName__c
Oleg Korol
articleNumber
000005794
ft:sourceType
Salesforce
FirstPublishedDate
2023-06-18T11:17:14Z
lastModifiedDate
2023-06-18
VersionNumber
1
You can do this by adding the following lines to the RabbitMQ configuration file located in ${XRAY_HOME}/app/bin/rabbitmq/rabbitmq.conf:
listeners.ssl.default = 5671
listeners.tcp = none
management.listener.ssl = true
ssl_options.cacertfile = ${XRAY_HOME}/var/data/rabbitmq/certs/ca_certificate.pem
ssl_options.certfile = ${XRAY_HOME}/var/data/rabbitmq/certs/server_xray_certificate.pem
ssl_options.keyfile = ${XRAY_HOME}/var/data/rabbitmq/certs/server_xray_key.pem
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = true

The listeners.ssl.default line tells RabbitMQ to listen for SSL/TLS connections on port 5671 and listeners.tcp disables non-TLS listeners, management.listener.ssl secures RabbitMQ management UI. The ssl_options.certfile and ssl_options.keyfile lines specify the paths to the server certificate and private key, respectively. The ssl_options.verify line tells RabbitMQ to verify the peer's certificate, and the ssl_options.fail_if_no_peer_cert line tells it to fail if the peer does not provide a certificate. Finally, the ssl_options.cacertfile line specifies the path to the certificate authority (CA) certificate that is used to verify the peer's certificate.