So i followed the guide here :
https://www.rabbitmq.com/ssl.htmlto create my own CA and my certificates.
My rabbit config looks like this:
[
{ssl, [{versions, ['tlsv1.2', 'tlsv1.1']}]},
{rabbit, [
{ssl_listeners, [5671]},
{auth_mechanisms, ['EXTERNAL', 'PLAIN']},
{ssl_apps,[asn1,crypto,public_key,ssl]},
{ssl_options, [{cacertfile,"/etc/rabbitmq/cert/ca/cacert.pem"},
{cacerts,"/etc/rabbitmq/cert/ca/cacert.pem"},
{certfile,"/etc/rabbitmq/cert/server_cert.pem"},
{keyfile,"/etc/rabbitmq/cert/server_key.pem"},
{versions, ['tlsv1.2', 'tlsv1.1']},
{ssl_cert_login, true},
{ssl_cert_login_from, common_name},
{verify,verify_peer},
{fail_if_no_peer_cert,false}]},
{log_levels, [{connection, debug}]}
]}
].
I can connect in the shell same as mentioned in paragraph "Check keys and certificates with OpenSSL"
But where i fail is when i try to connect to the broker directly like this:
openssl s_client -connect
127.0.0.1:5002 -cert client/cert.pem -key client/key.pem -CAfile cacert.pem -tls1_2
The output from the server is:
Error on AMQP connection <0.1147.0>:
{ssl_upgrade_error,{tls_alert,"unknown ca"}}
Supervisor: {local,tls_connection_sup}
Context: child_terminated
Reason: {badarg,
[{ets,update_counter,[381005,#Ref<0.0.0.86782>,-1],[]},
{ssl_pkix_db,ref_count,3,
[{file,"ssl_pkix_db.erl"},{line,184}]},
{ssl_connection,handle_trusted_certs_db,1,
[{file,"ssl_connection.erl"},{line,1799}]},
{ssl_connection,terminate,3,
[{file,"ssl_connection.erl"},{line,912}]},
{tls_connection,terminate,3,
[{file,"tls_connection.erl"},{line,326}]},
{gen_fsm,terminate,7,[{file,"gen_fsm.erl"},{line,595}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,237}]}]}
Offender: [{pid,<0.1148.0>},
{name,undefined},
{mfargs,{tls_connection,start_link,undefined}},
{restart_type,temporary},
{shutdown,4000},
{child_type,worker}]
The client throws this error:
140735329915728:error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca:s3_pkt.c:1472:SSL alert number 48
140735329915728:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:s3_pkt.c:656:
I have consulted google, but so far nothing that helped me...
Cheers,
Nick