Hi,
I am trying to set up inter-node TLS on a Windows RabbitMQ cluster (as per
https://www.rabbitmq.com/clustering-ssl.html). To configure it, I put the rabbitmq-env-conf.bat on each node, and restart the RabbitMQ windows service on each. After this I can no longer run commands using rabbitmqctl. Before configuring TLS, the commands worked. The erlang cookie is the same on the install user profile and C:\Windows\System32\config\systemprofile on each node. I have previously configured client TLS (as per
https://www.rabbitmq.com/ssl.html) and it works fine, and they use the same certificate files.
In the user guide, it states "CLI tools such as rabbitmqctl and rabbitmq-diagnostics also must use TLS to talk to the node". How can I make these tools use TLS? And how can I verify that the system is using TLS once configured?
I have read many pages of RabbitMQ docs and tried various things so apologies in advance if I've missed something obvious!
Thanks in advance for any help.
----------------------
Additional info:
The error when running any rabbitmqctl command is as follows:
Error: unable to perform an operation on node 'rabbit@server'. Please see diagnostics information and suggestions below.
Most common reasons for this are:
* Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
* CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
* Target node is not running
In addition to the diagnostics info below:
* Consult server logs on node rabbit@server
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: ['rabbit@server']
rabbit@server:
* connected to epmd (port 4369) on server
* epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
* TCP connection succeeded but Erlang distribution failed
* suggestion: check if the Erlang cookie identical for all server nodes and CLI tools
* suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other
* suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that
Current node details:
* node name: 'rabbitmqcli-6452-rabbit@server'
* effective user's home directory: C:\Users\myuser
* Erlang cookie hash: Tgfip9t+sPqsYPSR6dR6RQ==
The rabbit environment config is as follows:
@echo off
rem NOTE: If spaces are present in any of these paths,
rem double quotes must be used.
rem NOTE: the following path is **system dependent** and will vary between Erlang versions
rem and installation paths
set SSL_PATH="C:/Program Files/erl10.5/lib/ssl-9.4/ebin"
rem -pa $ERL_SSL_PATH prepends the directory ERL_SSL_PATH points at to the code path
rem -proto_dist inet_tls tells the runtime to encrypt inter-node communication
rem -ssl_dist_optfile tells the runtime where to find its inter-node TLS configuration file
set SERVER_ADDITIONAL_ERL_ARGS=-pa %SSL_PATH% ^
-proto_dist inet_tls ^
-ssl_dist_optfile C:/ProgramData/RabbitMQ/inter_node_tls.config
rem Same as above but for CLI tools
set CTL_ERL_ARGS=-pa %SSL_PATH% ^
-proto_dist inet_tls ^
-ssl_dist_optfile C:/ProgramData/RabbitMQ/inter_node_tls.config
The inter_node_tls is as follows (tried with both verify_peer and verify_none):
[
{server, [
{cacertfile,"C:/ProgramData/RabbitMq/MyCA.pem"},
{certfile, "C:/ProgramData/RabbitMq/server.pem"},
{keyfile, "C:/ProgramData/RabbitMq/server.key"},
{secure_renegotiate, true},
{verify, verify_none},
{fail_if_no_peer_cert, true}
]},
{client, [
{cacertfile,"C:/ProgramData/RabbitMq/MyCA.pem"},
{certfile, "C:/ProgramData/RabbitMq/server.pem"},
{keyfile, "C:/ProgramData/RabbitMq/server.key"},
{secure_renegotiate, true},
{verify, verify_none},
{fail_if_no_peer_cert, true}
]}
].