RabbitMQ Web Stomp——关闭非 TLS 连接?

RabbitMQ Web Stomp -- Turn off non-TLS connections?

我有一个运行良好的 RabbitMQ 实例(运行 当前的 3.7.9 + Erlang 21.1.1)。

我使用 Web Stomp 插件通过 websockets 和 stomp.js 使值在浏览器中可用。这也很好用。

我的问题是:如何使用新格式的 .conf 文件禁用非 TLS 连接?我想确保我们不会意外连接到错误的端口。下面是我的 .conf 文件供参考。

当前监听端口:

绑定到端口的协议

amqp::5672

amqp/ssl::5671

聚类:: 25672

http/web-stomp::15674

https::15672

https/web-stomp::15671

践踏:: 61613

listeners.ssl.default = 5671
ssl_options.cacertfile = fullchain.pem
ssl_options.certfile   = cert.pem
ssl_options.keyfile    = privkey.pem
ssl_options.verify     = verify_peer
ssl_options.fail_if_no_peer_cert = false

management.listener.port = 15672
management.listener.ssl = true
management.listener.ssl_opts.cacertfile = fullchain.pem
management.listener.ssl_opts.certfile = cert.pem
management.listener.ssl_opts.keyfile = privkey.pem

web_stomp.ssl.port       = 15671
web_stomp.ssl.backlog    = 1024
web_stomp.ssl.certfile   = cert.pem
web_stomp.ssl.keyfile    = privkey.pem
web_stomp.ssl.cacertfile = fullchain.pem

以下链接非常有用,但我没有找到答案。 https://www.rabbitmq.com/ssl.html#peer-verification

https://www.rabbitmq.com/web-stomp.html

从版本 3.7.9 开始,无法禁用 HTTP 侦听器。我建议使用以下设置将侦听器限制为仅 localhost

web_stomp.tcp.ip = 127.0.0.1

如果您检查 netstat -pan | fgrep beam.smp 的输出,您将看到端口 15674 绑定到 localhost 侦听器。


注意: RabbitMQ 团队监控 the rabbitmq-users mailing list 并且有时只在 Whosebug 上回答问题。