whiteberryapps
whiteberryapps

Reputation: 1392

RabbitMQ Over SSL

I'm trying to set RabbitMQ to work over SSL.

I have changed the configuration file (/etc/rabbitmq/rabbitmq.config) as mentioned in the following link https://www.rabbitmq.com/ssl.html to:

# Defaults to rabbit. This can be useful if you want to run more than one node
# per machine - RABBITMQ_NODENAME should be unique per erlang-node-and-machine
# combination. See the clustering on a single machine guide for details:
# http://www.rabbitmq.com/clustering.html#single-machine
#NODENAME=rabbit

# By default RabbitMQ will bind to all interfaces, on IPv4 and IPv6 if
# available. Set this if you only want to bind to one network interface or#
# address family.
#NODE_IP_ADDRESS=127.0.0.1

# Defaults to 5672.
#NODE_PORT=5672

listeners.ssl.default = 5671

ssl_options.cacertfile = /home/myuser/rootca.crt
ssl_options.certfile   = /home/myuser/mydomain.com.crt
ssl_options.keyfile    = /home/myuser/mydomain.com.key
ssl_options.verify     = verify_peer
ssl_options.password   = 1234
ssl_options.fail_if_no_peer_cert = false

I keep getting the following errors:

sudo rabbitmq-server
/usr/lib/rabbitmq/bin/rabbitmq-server: 15: /etc/rabbitmq/rabbitmq-env.conf: listeners.ssl.default: not found

If I remove the above line I get the following error:

sudo rabbitmq-server
/usr/lib/rabbitmq/bin/rabbitmq-server: 17: /etc/rabbitmq/rabbitmq-env.conf: ssl_options.cacertfile: not found

It is worth to mention that without the above, SSL configuration, everything works just fine.

Could you please assist?

Thanks :)

Upvotes: 1

Views: 1589

Answers (2)

Luke Bakken
Luke Bakken

Reputation: 9657

It's very important when you request assistance with software that you always state what version of the software you're using. In the case of RabbitMQ, providing the Erlang version and operating system used is also necessary.

In your case, you have (commented-out) environment configuration in /etc/rabbitmq/rabbitmq-env.conf, as well as RabbitMQ configuration, which is not correct. The following lines must be removed from rabbitmq-env.conf and put into the /etc/rabbitmq/rabbitmq.conf file:

listeners.ssl.default = 5671

ssl_options.cacertfile = /home/myuser/rootca.crt
ssl_options.certfile   = /home/myuser/mydomain.com.crt
ssl_options.keyfile    = /home/myuser/mydomain.com.key
ssl_options.verify     = verify_peer
ssl_options.password   = 1234
ssl_options.fail_if_no_peer_cert = false

Please also see the documentation

Upvotes: 1

Rozi_Me
Rozi_Me

Reputation: 14

in the Rabbitmq.config change the following to listen on 5673

listeners.ssl.default = 5673

Upvotes: 0

Related Questions