首页 > 解决方案 > RabbitMQ Web Stomp -- 关闭非 TLS 连接?

问题描述

我有一个运行良好的 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

标签: rabbitmqweb-stomp

解决方案


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

web_stomp.tcp.ip = 127.0.0.1

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


注意: RabbitMQ 团队会监控邮件列表rabbitmq-users有时只会在 StackOverflow 上回答问题。


推荐阅读