我已将RabbitMQ rabbitmq.config
文件配置为新的端口号,即使用SSL的5671。
现在我要禁用默认端口,即5672。
配置文件如下: -
[
{rabbit, [
{ssl_listeners, [5671]},
{ssl_options, [{cacertfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cacert.pem"},
{certfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cert.pem"},
{keyfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/key.pem"},
{verify,verify_peer},
{fail_if_no_peer_cert,false},
{ciphers,[{dhe_rsa,aes_256_cbc,sha},
{dhe_dss,aes_256_cbc,sha},
{rsa,aes_256_cbc,sha}]}
]
}
]}
].
现在它在端口5671和5672上工作。但是我需要禁用端口5672。 提出一些意见或建议。
提前致谢。
答案 0 :(得分:22)
要禁用标准RabbitMQ 5672端口,请将{tcp_listeners, []}
添加到rabbitmq.conf:
[
{rabbit, [
{tcp_listeners, []},
{ssl_listeners, [5671]},
{ssl_options, [{cacertfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cacert.pem"},
{certfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/cert.pem"},
{keyfile,"/ay/app/xxx/softwares/rabbitmq_server-3.1.1/etc/ssl/key.pem"},
{verify,verify_peer},
{fail_if_no_peer_cert,false},
{ciphers,[{dhe_rsa,aes_256_cbc,sha},
{dhe_dss,aes_256_cbc,sha},
{rsa,aes_256_cbc,sha}]}
]
}
]}
].
适用于RabbitMQ 3.1.5
答案 1 :(得分:4)
以下是使用new configuration file format introduced in RabbitMQ 3.7:
的方法listeners.ssl.1 = 5671
ssl_options.cacertfile = /path/to/testca/cacert.pem
ssl_options.certfile = /path/to/server/cert.pem
ssl_options.keyfile = /path/to/server/key.pem
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = false
[
{rabbit,
[{tcp_listeners, []}
]}
].
答案 2 :(得分:1)
似乎要禁用新文件格式的非SSL侦听,可以执行以下操作:
listeners.tcp = none
这与其他3.7答案具有相同的效果,但无需在advanced.config中执行此操作。