<div dir="ltr">Hello,<br><br>I've been trying to get mosquitto_sub to connect to RabbitMQ, when I perform a test using <a href="http://test.mosquitto.org" target="_blank">test.mosquitto.org</a>
and their certificate it works fine and when I connect to my RabbitMQ
using OpenSSL s_client and I supply the CAfile it performs the handshake
correctly. However this fails when sending the CAfile via mosquitto_sub<br><br>vagrant@precise32:/opt/data$ ./mosquitto-1.2.2/client/<div dir="ltr"><wbr>mosquitto_sub -h **.***.***.** -p 8883 -t "#" -d --cafile DigiCertEA.pem --tls-version tlsv1<br>Client mosqsub/3530-precise32 sending CONNECT<br>OpenSSL Error: error:14090086:SSL routines:SSL3_GET_SERVER_<wbr>CERTIFICATE:certificate verify failed<br>Error: Protocol error<br><br>RabbitMQ = 3.2.0<br>OpenSSL = 1.0.1<br>Erlang = R16B<br><br>This
is the detail from my log in RabbitMQ. The CAfiles have slightly
different names but using openssl x509 -in -text -noout gives the same
serial number<br><br>=ERROR REPORT==== 28-Oct-2013::12:52:02 ===<br>SSL: certify: tls_connection.erl:2286:Fatal error: certificate unknown<br><br>=ERROR REPORT==== 28-Oct-2013::12:52:07 ===<br>** Generic server <0.594.0> terminating <br>** Last message in was {inet_async,#Port<0.14157>,<wbr>35762,{ok,#Port<0.15830>}}<br>** When Server state == {state,<br> {rabbit_mqtt_sup,start_ssl_<wbr>client,<br> <wbr> [[{cacertfile,"/etc/ssl/certs/<wbr>DigiCertCA.pem"},<br> <wbr> {certfile,<br> <wbr> "/etc/ssl/certs/star_*****_***<wbr>*_net_chain.pem"},<br> <wbr> {keyfile,<br> <wbr> "/etc/ssl/private/*****.****.<wbr>net.key"},<br> <wbr> {verify,verify_none},<br> <wbr> {fail_if_no_peer_cert,false}]]<wbr>},<br> #Port<0.14157>,35762}<br>** Reason for termination == <br>** {timeout,{gen_server2,call,<br> [<0.596.0>,<br> {go,#Port<0.15830>,<br> #Fun<rabbit_networking.2.<wbr>65720357>}]}}<br><br>=ERROR REPORT==== 28-Oct-2013::12:52:07 ===<br>** Generic server <0.596.0> terminating<br>** Last message in was {go,#Port<0.15830>,#Fun<<wbr>rabbit_networking.2.65720357>}<br>** When Server state == undefined<br>** Reason for termination == <br>** {{badmatch,{error,{ssl_<wbr>upgrade_error,{tls_alert,"<wbr>certificate unknown"}}}},<br> [{rabbit_mqtt_reader,handle_<wbr>call,3,[]},<br> {gen_server2,handle_msg,2,[]},<br> {proc_lib,init_p_do_apply,3,[{<wbr>file,"proc_lib.erl"},{line,<wbr>239}]}]}<br><br>Is
this a problem with RabbitMQ or perhaps the mosquitto_sub client? If it
belongs to the latter I guess I should redirect my question :)<br><br>Cheers,<br>Dan</div></div>