Py学习  »  MQ

SSL上的RabbitMQ

whiteberryapps • 4 年前 • 1244 次点击  

我正试图将rabbitmq设置为在ssl上工作。

我已经更改了配置文件(/etc/rabbitmq/rabbitmq.config),如下链接所述 https://www.rabbitmq.com/ssl.html 到:

# 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

我一直有以下错误:

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

如果删除上述行,则会出现以下错误:

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

值得一提的是,如果没有上述ssl配置,一切都可以正常工作。

你能帮忙吗?

谢谢)

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/44291
 
1244 次点击  
文章 [ 1 ]  |  最新文章 4 年前
Luke Bakken
Reply   •   1 楼
Luke Bakken    5 年前

当你请求软件方面的帮助时,说明你正在使用的软件版本是非常重要的。对于rabbitmq,还需要提供所使用的erlang版本和操作系统。

在您的例子中,您已经在 /etc/rabbitmq/rabbitmq-env.conf ,以及rabbitmq配置,这是不正确的。必须从中删除以下行 rabbitmq-env.conf 把它放进 /etc/rabbitmq/rabbitmq.conf 文件:

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

也请看 the documentation


音符: RabbitMQ团队监控 rabbitmq-users mailing list 有时只在stackoverflow上回答问题。