[rabbitmq-discuss] Create an encrypted SSL connection without having to verify certificate

Ankur5 C ankur5.c at tcs.com
Thu Jul 31 09:06:09 BST 2014


Here is my code:

The same one which has been given in your example. 

import java.io.*;
import java.security.*;


import com.rabbitmq.client.*;

public class Example1
{
    public static void main(String[] args) throws Exception
    {

        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("192.168.161.197");
        factory.setPort(5671);

        factory.useSslProtocol();
        // Tells the library to setup the default Key and Trust managers 
for you
        // which do not do any form of remote server trust verification

        Connection conn = factory.newConnection();
        Channel channel = conn.createChannel();

        //non-durable, exclusive, auto-delete queue
        channel.queueDeclare("rabbitmq-java-test", false, true, true, 
null);
        channel.basicPublish("", "rabbitmq-java-test", null, "Hello, 
World".getBytes());


        GetResponse chResponse = channel.basicGet("rabbitmq-java-test", 
false);
        if(chResponse == null) {
            System.out.println("No message retrieved");
        } else {
            byte[] body = chResponse.getBody();
            System.out.println("Recieved: " + new String(body));
        }


        channel.close();
        conn.close();
    }
}

Thanks and Regards,
Ankur Chakraborty
Mailto: ankur5.c at tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Consulting
____________________________________________



From:   Michael Klishin <mklishin at pivotal.io>
To:     Ankur5 C <ankur5.c at tcs.com>
Cc:     Legacy list about RabbitMQ <rabbitmq-discuss at lists.rabbitmq.com>
Date:   31-07-2014 12:39
Subject:        Re: [rabbitmq-discuss] Create an encrypted SSL connection 
without having to verify certificate



On 31 July 2014 at 11:04:07, Ankur5 C (ankur5.c at tcs.com) wrote:
> >
> But could you please try once with the example given in :
> 
> https://www.rabbitmq.com/ssl.html: Connecting without 
> validating certificates

Ankur,

The example in https://gist.github.com/michaelklishin/4146cec261f0fd30cc07
is no different from "Connecting without validating certificates" on
https://www.rabbitmq.com/ssl.html in the key part: how it sets up
a ConnectionFactory instance.

I assure you it is *not* a RabbitMQ issue, there's enough evidence
of that in this thread alone. Something is wrong with your code
(which you never posted) or your local environment. 

Please proceed to investigate the issue on your own.

If this still seems too hard, Pivotal offers professional services around 
RabbitMQ. Email info at rabbitmq.com to find out more.
-- 
MK 

Staff Software Engineer, Pivotal/RabbitMQ

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


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


More information about the rabbitmq-discuss mailing list