PDA

View Full Version : using ssl protocol



vveludan
Nov 10th, 2011, 12:32 PM
Good afternoon.
RabbitMq Java Client's ConnectionFactory facilitates using ssl protocol. Is CachingConnectionFactory in future will provide this option.

Thanks
Venkat

Mark Fisher
Nov 10th, 2011, 12:43 PM
CachingConnectionFactory is basically a "wrapper" and can be configured with any instance of com.rabbitmq.client.ConnectionFactory as its target, so that should allow you to use any functionality you want on that target.

vveludan
Nov 10th, 2011, 02:03 PM
Good afternoon Mark. I appreciate and thank you for your feedback.
I could make use of ssl protocol. Following is the code snippet:

try {
ConnectionFactory cf = new ConnectionFactory();
cf.setHost("localhost");
cf.setUsername("guest");
cf.setPassword("guest");
cf.setPort(5672);
cf.useSslProtocol();
CachingConnectionFactory ccf = new CachingConnectionFactory(cf);
} catch (KeyManagementException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}