Hello,
Can the erlang rabbitmq client verify the server's tls certificate
matches its common name?
With my server configured with a commercial certificate, listening on
fizz.com:
[
{rabbit, [
{ssl_listeners, [{"0.0.0.0", 5671}]},
{ssl_options, [
{cacertfile,"${cert_dir}/fullchain.pem"},
{certfile,"${cert_dir}/cert.pem"},
{keyfile,"${cert_dir}/key.pem"},
{verify,verify_none},
{fail_if_no_peer_cert,false}]},
{log_levels, [{connection, debug}]}
]},
{rabbitmq_management, [{listener, [{port, 15672}]}]}
].
And my client connecting with verify enabled, connecting to
buzz.com,
which points to the same server, serving the certificate for
fizz.com:
amqp_connection:start(#amqp_params_network{
username = <<"foobar">>,
password= <<"foobar">>,
host = "
buzz.com",
port = 5671,
ssl_options = [
{verify, verify_peer},
{cacertfile, "/etc/ssl/certs/ca-certificates.crt"}
{fail_if_no_peer_cert, true}
]
}).
I get no error, the client doesn't check to see if the CN matches the
hostname. Compared to openssl which has the correct behavior:
$ openssl s_client -connect
buzz.com:5671 -verify_hostname
buzz.com
...snip...
Verify return code: 62 (Hostname mismatch)
Can the erlang rabbitmq client verify the CN matches?
Thank you,
Graham Christensen