[rabbitmq-discuss] Client certificate based authentication over SSL

Vinay Nayak virus.vinay at gmail.com
Thu Mar 27 14:56:56 GMT 2014

Hi there,

 We are trying to configure client certificate based authentication over 
SSL on our rabbitmq server. However we have hit an issue which we are 
unable to get past.

Can someone please help us figure out the solution?

Our configuration steps are as follows:

1)    Our RabbitMQ version is: 3.2.3 ErLang R16B03-1

2) We would like to achieve password-less authentication using client 
certificate and LDAP authorisation.

3) For client certificates, we installed a stand-alone microsoft pki 
certification authority on our windows server 2008 R2 machine

4) We then issued a client certificate via the certificate manager web 
portal i.e.

(https://<servername>/certmgr -> Request a certificate -> Advanced 
certificate request -> Create and submit a request to this CA -> Filled in 
the details (with Client Authentication Certificate option selected)-> 
Submitted the request -> Approved -> Installed.

Please note the Name on the certificate was set as username at domain.com 
(which is the CN for the user name in AD)

5) We then issued an SSL certificate via the certificate manager web portal 
i.e. the same steps as above but this time had the “Server Authentication 
Certificate” selected

Please note the Name on the certificate was set as machine at domain.com

6) Downloaded the CA root certificate in .cer format and converted it into 
.pem using openssl

7) Downloaded the Server certificate (from step 5) in .pfx format. It was 
then separated into ServerCertificate.pem and ServerCertificateKey.pem 
using openssl

8) Downloaded the Client certificate (from step 4) in .pfx format. It was 
then separated into Cert.pem/ Key.pem and then combined into 
ClientCertificate.p12 using openssl

9) Our rabbitmq config is:


            [{auth_backends, [rabbit_auth_backend_ldap]},

            {auth_mechanisms, ['EXTERNAL']},

            {ssl_listeners, [{"", 5671}]},


                        [{cacertfile,"C:/Program Files (x86)/RabbitMQ 

        {certfile,"C:/Program Files (x86)/RabbitMQ 

        {keyfile,"C:/Program Files (x86)/RabbitMQ 



            {ssl_cert_login_from, common_name}]




            {servers,               ["xxxxxxx.yyyyy.com"]},

            {dn_lookup_attribute,   "userPrincipalName"},

            {dn_lookup_base,        "DC= yyyyy,DC=com"},

            {use_ssl,               true},

            {port,                  636},

    {log,                   network},

    {vhost_access_query,    {in_group,

        "ou=${vhost}-users,ou=computers,dc= yyyyy,dc=com"}},



                                    [{permission, configure, {in_group, 
"cn=domain users,dc= yyyyy,dc=com"}},

                                    {permission, write,

              {for, [{resource, queue,    {in_group, "cn=domain users,dc= 

exchange, {constant, true}}]}},

             {permission, read,

              {for, [{resource, exchange, {in_group, "cn=domain users,dc= 

                     {resource, queue,    {constant, true}}]}}



            {tag_queries,           [{administrator, {constant, true}},

        {management,    {constant, true}}]}


10) Our client code is:

            cf.Ssl.ServerName = <CN Name of the server certificate i.e. 
machine at domain.com>

            cf.Ssl.CertPath = @"C:\Program Files (x86)\RabbitMQ 

            cf.Ssl.CertPassphrase = "rabbitmq";

            cf.Ssl.Enabled = true;

            cf.Ssl.AcceptablePolicyErrors = 
System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch |



11) And following is our log:

=INFO REPORT==== 27-Mar-2014::14:35:23 ===

accepting AMQP connection <0.322.0> (a.b.c.d:2935 -> a.b.c.d:5671)


=INFO REPORT==== 27-Mar-2014::14:35:23 ===

LDAP CHECK: passwordless login for username at domain.com


=ERROR REPORT==== 27-Mar-2014::14:35:26 ===

closing AMQP connection <0.322.0> (a.b.c.d:2935 -> a.b.c.d:5671):












And the .net error is “Possibly caused by authentication failure”




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140327/5362c523/attachment.html>

More information about the rabbitmq-discuss mailing list