Connecting to a Websphere MQ in Java with SSL/Keystore

Posted by javaExpert on Stack Overflow See other posts from Stack Overflow or by javaExpert
Published on 2010-04-22T15:17:14Z Indexed on 2010/04/25 6:13 UTC
Read the original article Hit count: 653

Filed under:
|
|

I'd like to connect to a Websphere 6.0 MQ via Java. I have already working code for a "normal" queue, but now I need to access a new queue which is SSL encrypted (keystore). I have been sent a file called something.jks, which I assume is a certificate I need to store somewhere. I have been searching the net, but I can't find the right information.

This is the code I use for the "normal" queue. I assume I need to set some property, but not sure which one.

MQQueueConnectionFactory connectionFactory = new MQQueueConnectionFactory();
connectionFactory.setChannel(channel_);
connectionFactory.setHostName(hostname_);
connectionFactory.setPort(port_);
connectionFactory.setQueueManager(queueManager_);
connectionFactory.setTransportType(1);
connectionFactory.setSSsetSSLCertStores(arg0)

Connection connection = connectionFactory.createConnection();
connection.setExceptionListener(this);
session_ = connection.createSession(DEFAULT_TRANSACTED, DEFAULT_ACKMODE);
connection.start();

javax.jms.Queue fQueue = session_.createQueue(queue_);
consumer = session_.createConsumer(fQueue);

© Stack Overflow or respective owner

Related posts about websphere-mq

Related posts about keystore