ssl rabbitmq如何只为某些特定的mqtts端口设置对等证书验证?

r1zk6ea1  于 2023-10-19  发布在  RabbitMQ
关注(0)|答案(1)|浏览(99)

在这里,我将fail_if_no_peer_cert设置为true,以启用客户端证书验证。我有两个MQTTS端口,分别是1884和2500。我只想对端口1884启用此对等验证。端口2500我想使用作为单向SSL与失败_if_no_peer_cert为假。
在rabbitmq.config中有办法做到这一点吗?
下面是我的rabbitmq.config文件

[
    { 
    rabbit, [
            { loopback_users, [ ] },
            { tcp_listeners, [ 5672 ] },
            { ssl_listeners, [  ] },
            { ssl_options, [{cacertfile,"/home/akila/test/tls-gen/basic/result/ca_certificate.pem"},
            {certfile,"/home/akila/test/tls-gen/basic/result/server_certificate.pem"},
            {keyfile,"/home/akila/test/tls-gen/basic/result/server_key.pem"},
            {versions, ['tlsv1.2', 'tlsv1.1']},
            {verify,verify_peer},
            {fail_if_no_peer_cert,true}]},
            { hipe_compile, false },
            { auth_backends, [rabbit_auth_backend_internal,rabbit_auth_backend_http]}
    ]
    },
    {rabbitmq_management, [ 
            { listener, [
                    { port, 15672 },
                    { ssl, false }
            ] } ] 
    },
    {rabbitmq_mqtt, [
            {ssl_listeners,    [1884,2500]},
            {tcp_listeners,    [1883]}
            ]}

].

相关问题