Skip to content

Instantly share code, notes, and snippets.

@carlhoerberg
Forked from lukebakken/README.md
Last active February 19, 2018 22:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlhoerberg/2ec256fd41feacb525c964b4f744fbff to your computer and use it in GitHub Desktop.
Save carlhoerberg/2ec256fd41feacb525c964b4f744fbff to your computer and use it in GitHub Desktop.
Restart RabbitMQ TLS acceptors with new settings

Restarting RabbitMQ TLS Listeners with new TLS options

Edit your /etc/rabbitmq/rabbitmq.config and then reload the settings from there with:

sudo rabbitmqctl eval '{ok, [C]} = file:consult("/etc/rabbitmq/rabbitmq.config"), {rabbit, R} = proplists:lookup(rabbit, C), {ssl_options, O} = proplists:lookup(ssl_options, R), application:set_env(rabbit, ssl_options, O).'

Restart the TLS Listener on port 5671

sudo rabbitmqctl eval 'rabbit_networking:stop_tcp_listener({{0,0,0,0},5671}), rabbit_networking:start_ssl_listener(5671, rabbit_networking:ensure_ssl(), 1).'

Compatible with RabbitMQ < 3.6:

sudo rabbitmqctl eval 'rabbit_networking:stop_tcp_listener({{0,0,0,0},5671}), catch rabbit_networking:start_ssl_listener(5671, rabbit_networking:ensure_ssl()), catch rabbit_networking:start_ssl_listener(5671, rabbit_networking:ensure_ssl(), 1).'

Restart all protocol plugins

sudo rabbitmq-plugins disable rabbitmq_{mqtt,stomp} && sudo rabbitmq-plugins enable rabbitmq_{mqtt,stomp}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment