rabbitmq - 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
解决方案
从版本3.7.9
开始,无法禁用 HTTP 侦听器。我建议使用以下设置将侦听器限制为localhost
:
web_stomp.tcp.ip = 127.0.0.1
如果您检查输出,netstat -pan | fgrep beam.smp
您将看到15674
绑定到localhost
侦听器的端口。
注意: RabbitMQ 团队会监控邮件列表,rabbitmq-users
有时只会在 StackOverflow 上回答问题。
推荐阅读
- ffmpeg - ffpmeg 提取帧会产生太多图像
- java - 正则表达式导致模式语法异常
- jakarta-ee - Quarkus OpenAPI 模式中未生成 JAX-RS 子资源
- android - 带有 Firebase InstanceId 接收器的 ANR
- mysql - 尽管有索引,但查询非常慢
- c# - 如何通过 C# 获取 Microsoft Word 中表格的排序类型(升序/降序)?
- python-3.x - 使用序列列表并编写一个程序,找到具有最高 GC 内容的序列
- security - 访问令牌和刷新令牌流程
- python - 变量声明但未定义的错误出现在python中
- reactjs - 多个字段的formik验证