Description
Hi there,
I'm trying to run the rabbitmq container with ssl/tls.
So far I got ssl/tls to work (i.e. a connection to the server is possible, messages are delivered, clients verified, etc.) - it's all good on that side.
However as soon as I try to manage the node with rabbitmqctl
I get the following error:
# docker exec -it rabbit-00 rabbitmqctl list_users
Error: unable to connect to node 'rabbit@rabbit-00': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@rabbit-00']
rabbit@rabbit-00:
* connected to epmd (port 4369) on rabbit-00
* epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failed
* Remote host closed TCP connection before completing authentication. Is the Erlang distribution using TLS?
current node details:
- node name: 'rabbitmq-cli-34@rabbit-00'
- home dir: /var/lib/rabbitmq
- cookie hash: blabla
I already tried the docker image cvtjnii/rabbitmq:3.6.1
which showed up in #69, which works fine.
(Note that using the /docker-entrypoint.sh
as a wrapper does not work with this official image:
# docker exec -it rabbit-00 /docker-entrypoint.sh rabbitmqctl list_users
Error: unable to connect to node 'rabbit@rabbit-00': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@rabbit-00']
rabbit@rabbit-00:
* connected to epmd (port 4369) on rabbit-00
* epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failed
* suggestion: hostname mismatch?
* suggestion: is the cookie set correctly?
* suggestion: is the Erlang distribution using TLS?
current node details:
- node name: 'rabbitmq-cli-52@rabbit-00'
- home dir: /var/lib/rabbitmq
- cookie hash: blabla
Here is my startup script - as I said, the TLS connection itself via port 5671 is working fine, but the rabbitmqctl
is not (which makes clustering and administration a little difficult).
#!/bin/bash
ERLANG_COOKIE="cookie"
SSL_LISTENERS="5671"
SSL_CACERTFILE="/certs/ca/cacert.pem"
SSL_CERTFILE="/certs/server/rabbit-00.vagrant.cert.pem"
SSL_KEYFILE="/certs/server/rabbit-00.vagrant.key.pem"
SSL_FAIL_IF_NO_PEER_CERT="false"
SSL_VERIFY="verify_peer"
docker run \
-d \
--restart=always \
--name rabbit-00 \
--hostname rabbit-00.vagrant \
-p 4369:4369 \
-p 5671:5671 \
-p 5672:5672 \
-p 15671:15671 \
-p 15672:15672 \
-p 25672:25672 \
-e RABBITMQ_ERLANG_COOKIE=$ERLANG_COOKIE \
-e RABBITMQ_SSL_CERT_FILE=$SSL_CERTFILE \
-e RABBITMQ_SSL_KEY_FILE=$SSL_KEYFILE \
-e RABBITMQ_SSL_CA_FILE=$SSL_CACERTFILE \
-e RABBITMQ_SSL_FAIL_IF_NO_PEER_CERT=$SSL_FAIL_IF_NO_PEER_CERT \
-e RABBITMQ_SSL_VERIFY=$SSL_VERIFY \
-v /srv/docker/rabbit/certs:/certs \
rabbitmq:3-management
Any help is appreciated. Thanks a lot!
Matthias
P.S. I already tried experimenting with the RABBITMQ_CTL_ERL_ARGS as in docker-entrypoint.sh#L277 but I had no luck so far. Maybe I'm just using it wrong...
Activity