【问题标题】:RabbitMQ Over SSL基于 SSL 的 RabbitMQ
【发布时间】:2019-07-04 19:17:36
【问题描述】:

我正在尝试将 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 配置,一切正常。

您能帮忙吗?

谢谢:)

【问题讨论】:

    标签: security ssl openssl rabbitmq


    【解决方案1】:

    当您请求软件方面的帮助时,务必说明您正在使用的软件版本,这一点非常重要。对于 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 上的问题。

    【讨论】:

      【解决方案2】:

      在 Rabbitmq.config 中更改以下内容以监听 5673

      listeners.ssl.default = 5673
      

      【讨论】:

        猜你喜欢
        • 2016-03-14
        • 2014-12-11
        • 2013-03-01
        • 2016-03-31
        • 2014-03-28
        • 2011-02-10
        • 2016-02-20
        • 1970-01-01
        • 2017-01-31
        相关资源
        最近更新 更多