0

I'm trying to connect to RabbitMQ server using SSL but i'm getting this error "SSL peer cert verification failed".

I check the certificate using openssl like so: openssl s_client -connect host:port -CAfile cacert.pem

And got "Verify return code: 0 (ok)" so i believe that the certificate is OK.

I'm trying to use the amqps_bind.c example in here.

I only need server verification so I removed the amqp_ssl_socket_set_key().

The code is failing in amqp_socket_open().

Also i have a C# code that can connect to the same server using SSL without any errors.

Amir Rossert
  • 226
  • 2
  • 15

2 Answers2

0

I have found my issue.

The cacert.pem file that I provided was all the chain of certificates.

After extracting only the root certificate I can connect to the sever.

Amir Rossert
  • 226
  • 2
  • 15
0

Apart from that check the following config also in your rabbitmq.config

{verify,verify_peer},
{fail_if_no_peer_cert,true}]},

change those to following if you do not want to verify peer

 {verify,verify_none},
 {fail_if_no_peer_cert,false}]},