我关注这个tutorial具有 SSL 连接的 RabbitMQ。
我已经为 ssl 连接配置了 5672 端口,我正在启动 openssl 工具
用于测试与本地端口的连接(是RabbitMQ的官方docker容器)。
我的 rabbitmq.config 是:
[{rabbit, [ {loopback_users, []},
{tcp_listeners, [5671]},
{ssl_listeners, [5672]},
{auth_mechanisms, ['EXTERNAL','PLAIN']},
{handshake_timeout, 60000},
{ssl_options, [
{cacertfile, "/etc/rabbitmq/ssl/ca/cacert.pem" },
{certfile, "/etc/rabbitmq/ssl/server/server.cert.pem" },
{keyfile, "/etc/rabbitmq/ssl/server/server.key.pem" },
{verify, verify_peer},
{ssl_cert_login_from, common_name},
{fail_if_no_peer_cert, true }]}]}].
然后我执行这个命令:
openssl s_client -connect localhost:5672 -cert ../client/client.pem -key ../client/client.key.pem -CAfile ../ca/cacert.pem
我在 RabbitMQ 日志中收到此错误:
=INFO REPORT==== 6-Apr-2016::14:16:06 ===
accepting AMQP connection <0.696.0> (127.0.0.1:34977 -> 127.0.0.1:5672)
=ERROR REPORT==== 6-Apr-2016::14:16:06 ===
closing AMQP connection <0.696.0> (127.0.0.1:34977 -> 127.0.0.1:5672):
{handshake_timeout,handshake}
最佳答案
当您看到 {handshake_timeout, handshake}
时,这通常意味着某些事情正在阻止 AMQP 握手(与 TCP 握手相反)完成。使用 Wireshark 跟踪网络流量可能会让您了解在握手过程中您失败的位置。
关于ssl - RabbitMQ 中的 ssl 连接握手超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36454573/