我正在尝试将ssl与haproxy和Rabbitmq结合使用 我有一个具有所有配置的节点示例客户端,但套接字挂了
这是我的haproxy配置以及我收到的错误
[ALERT] 274/084045 (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:10] : 'bind 0.0.0.0:5671' : unable to load SSL certificate from PEM file '/usr/local/etc/haproxy/key.pem'.
[ALERT] 274/084045 (1) : Error(s) found in configuration file : /usr/local/etc/haproxy/haproxy.cfg
[ALERT] 274/084045 (1) : Fatal errors found in configuration.
haproxy.cfg :(我也尝试过将pem保密)
global
maxconn 4096
defaults
timeout connect 60s
timeout client 60s
timeout server 60s
listen rabbitmq
bind 0.0.0.0:5671 ssl crt /usr/local/etc/haproxy/key.pem
balance roundrobin
server rabbit1 rabbit1:5671 check inter 2000 fall 3
server rabbit2 rabbit2:5671 check inter 2000 fall 3
server rabbit3 rabbit3:5671 check inter 2000 fall 3
listen rabbitmq-ui
bind 0.0.0.0:15672
balance roundrobin
server rabbit1 rabbit1:15672 check inter 2000 fall 3
server rabbit2 rabbit2:15672 check inter 2000 fall 3
server rabbit3 rabbit3:15672 check inter 2000 fall 3
兔子配置:
[{rabbit, [
{loopback_users, []},
{vm_memory_high_watermark, 0.85},
{vm_memory_high_watermark_paging_ratio, 0.8},
{ tcp_listeners, [5672] },
{ ssl_listeners, [5671] },
{ ssl_options, [
{cacertfile,"/run/secrets/ca_certificate"},
{certfile,"/run/secrets/server_certificate"},
{keyfile,"/run/secrets/server_key"},
{verify,verify_peer},
{fail_if_no_peer_cert,true},
{versions, ['tlsv1.2', 'tlsv1.1']}
]}
]}
].