Miguel
Miguel

Reputation: 939

Handshake timeout ERROR with ssl connection in RabbitMQ

I am follow this tutorial of RabbitMQ with ssl connections.

I have configured the 5672 port for ssl connections and I am launching openssl tool

for testing the connection to the port in local(Is a offical docker container of RabbitMQ).

My rabbitmq.config is:

[{rabbit,   [ {loopback_users, []},
       {tcp_listeners, [5671]},
       {ssl_listeners, [5672]},
       {auth_mechanisms, ['EXTERNAL','PLAIN']},
       {handshake_timeout, 60000},
       {ssl_options, [
         {cacertfile, "/etc/rabbitmq/ssl/ca/cacert.pem" },
         {certfile, "/etc/rabbitmq/ssl/server/server.cert.pem" },
         {keyfile, "/etc/rabbitmq/ssl/server/server.key.pem" },
         {verify, verify_peer},
         {ssl_cert_login_from, common_name},
         {fail_if_no_peer_cert, true }]}]}].

Then I execute this command:

openssl s_client -connect localhost:5672 -cert ../client/client.pem -key ../client/client.key.pem -CAfile ../ca/cacert.pem

And I get this error in the RabbitMQ logs:

=INFO REPORT==== 6-Apr-2016::14:16:06 ===
accepting AMQP connection <0.696.0> (127.0.0.1:34977 -> 127.0.0.1:5672)

=ERROR REPORT==== 6-Apr-2016::14:16:06 ===
closing AMQP connection <0.696.0> (127.0.0.1:34977 -> 127.0.0.1:5672):
{handshake_timeout,handshake}

Upvotes: 4

Views: 9166

Answers (1)

bshroyer
bshroyer

Reputation: 121

When you see {handshake_timeout, handshake}, it usually means that something is preventing the AMQP handshake (as opposed to the TCP handshake) from completing. Following the network traffic with Wireshark might give you an idea of where in the handshake process you're failing.

Upvotes: 6

Related Questions