ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Problems with SSL for MQ client connection

Post new topic  Reply to topic
 Problems with SSL for MQ client connection « View previous topic :: View next topic » 
Author Message
hilltops
PostPosted: Wed Sep 06, 2006 5:06 am    Post subject: Problems with SSL for MQ client connection Reply with quote

Centurion

Joined: 01 Mar 2006
Posts: 112

I have a problem with my configuration for SSL on an MQI client connection using self-signed certificates. I am using MQ V6 and have installed the gskit. The client is on a Windows box while the server is on a linux box. The rest of the configuration is as follows;

On the server

Queue manager name = DNLCAZ5CPS

And created the keystore as follows;

gsk7cmd -keydb -create -db /var/mqm/qmgrs/DNLCAZ5CPS/ssl/key.kdb -pw cms -type cms -expire 365 -stash

chmod g+r /var/mqm/qmgrs/DNLCAZ5CPS/ssl/key.kdb
chmod g+r /var/mqm/qmgrs/DNLCAZ5CPS/ssl/key.sth

Created the self-signed certificate as follows;

gsk7cmd -cert -create -db /var/mqm/qmgrs/DNLCAZ5CPS/ssl/key.kdb -pw cms -label ibmwebspheremqjoebloggs -dn "CN=DNLCAZ5CPS,O=XXXX,OU=Middleware,C=UK" -size 1024 -expire 365

defined the svrconn as

DEFINE CHANNEL(TO.DNLCAZ5CPS.SSL) CHLTYPE(SVRCONN) TRPTYPE(TCP) +
DESCR('Server connection on queue manager DNLCAZ5CPS') +
MCAUSER('joebloggs') +
SSLCIPH(RC4_MD5_EXPORT) +
SSLPEER('CN=DNLCAZ5CPS,O=XXXX,OU=Middleware,C=UK') +
SSLCAUTH(REQUIRED) +
replace

With the display qmgr command I get
SSLKEYR(/var/mqm/qmgrs/SDBC01EGDS/ssl/key) amonsgt other.

On the Client side

Created a directory call ssl under D:\Program Files\IBM\WebSphere MQ\

Run the following script to create the repository in the directory you just created.

runmqckm -keydb -create -db "D:\Program Files\IBM\WebSphere MQ\ssl\key.sto" -pw cms -type cms -expire 365 -stash


Run the script to create a certificate and store in repository.

runmqckm -cert -create -db "D:\Program Files\IBM\WebSphere MQ\ssl\key.sto" -pw cms -label ibmwebspheremqjoebloggs -dn "CN=DNLCAZ5CPS,O=XXXX,OU=Middleware,C=UK" -size 1024 -expire 365


Set the environment variable that point to the repository

set MQSSLKEYR=D:\Program Files\IBM\WebSphere MQ\ssl\key

The java application on the client side is coded with the following properties;

MQEnvironment.hostname = server;
MQEnvironment.channel = "TO.DNLCAZ5CPS.SSL";
MQEnvironment.port = 15000;
MQEnvironment.sslCipherSuite = "SSL_RSA_EXPORT_WITH_RC4_40_MD5";
MQEnvironment.sslPeerName = "CN=DNLCAZ5CPS,O=XXXX,OU=Middleware,C=UK";

When application is run I get :

MQJE001: An MQException occurred: Completion Code 2, Reason 2397
MQJE056: Initial negotiation failure
MQJE001: Completion Code 2, Reason 2397
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2397

Any help?

Thankx
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Sep 06, 2006 5:07 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Java applications have to use JKS keystores, not CMS keystores.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Sep 06, 2006 5:58 am    Post subject: Re: Problems with SSL for MQ client connection Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

The following (Windows-oriented) HOWTO document might help: http://www.ibm.com/support/docview.wss?rs=171&uid=swg21233897
Back to top
View user's profile Send private message
hilltops
PostPosted: Wed Sep 06, 2006 9:31 am    Post subject: Reply with quote

Centurion

Joined: 01 Mar 2006
Posts: 112

I have now create jks keystore and added a self-signed certificate as follows:

runmqckm -keydb -create -db compass.jks -type jks -pw c0mp4ss

runmqckm -cert -create -db compass.jks -pw c0mp4ss -label ibmwebspheremqjoebloggs -dn "CN=DNLCAZ5CPS,O=XXXX,OU=Middleware,C=UK" -size 1024 -expire 365

While still on the Windows client machine, I used the contact admin command to start a cmd windows for user joebloggs (contact admin /user:joebloggs cmd). The certificate label was for a user called joebloggs.

I run the java application in this new window as:

java -Djavax.net.ssl.keyStore=c:\TEST\compass.jks -Djavax.net.ssl.keyStorePassword=c0mp4ss -Djavax.net.ssl.trustStore=C:\TEST\compass.jks MQSample2"

I get the same problem.

These server configuration has not changed.
Back to top
View user's profile Send private message
Ivans
PostPosted: Wed Sep 06, 2006 11:37 pm    Post subject: Reply with quote

Apprentice

Joined: 03 Jan 2006
Posts: 48
Location: Hursley

Hi hilltops,

The problems with your config include...
* You are creating one certificate on the server and one on the client and not extracting/adding them to the separate keystores. You have SSLCAUTH(REQUIRED) so both the client and server must have their own seperate certs and you must extract each cert and add it to the other's keystore.
* The queue manager certificate must be labelled ibmwebspheremqdnlcaz5cps
* The cipherspecs must match on the each end of the channel

Please read the SSL portions of the WMQ Security manual and take a look at supportpac MO04 (WMQ SSL Wizard) which will generate sample MQSC/GSKit commands and supplies sample Java client source code too. And it's free!

MO04 can be googled or see here... http://www.ibm.com/support/docview.wss?rs=171&uid=swg24010367&loc=en_US&cs=utf-8&lang=en

Cheers,
Ian
Back to top
View user's profile Send private message
hilltops
PostPosted: Thu Sep 07, 2006 8:21 am    Post subject: Reply with quote

Centurion

Joined: 01 Mar 2006
Posts: 112

Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 07, 2006 2:36 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So If I understood right you have a cert with a private key in Win and a cert with a private key in linux. They are both signed by the same "CA" authority, and never shall the twain meet.....

Send the public key from Win to Linux and the public key from linux to the Win keystore and import on each side...

After that you might have more luck...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Fri Sep 08, 2006 1:44 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

hilltops wrote:
I still get RC 2397

Apparently (see http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqsao.doc/csq0519.htm and scroll down to the description of 2397 MQRC_JSSE_ERROR) there is more information in the associated JSSE Exception, which you can get by calling MQException.getCause().
Back to top
View user's profile Send private message
hilltops
PostPosted: Fri Sep 08, 2006 8:18 am    Post subject: Reply with quote

Centurion

Joined: 01 Mar 2006
Posts: 112

The MQ security manual V6.0 (csqzas02.pdf) on page 26 say ;

"If the server requires client authentication, the server verifies the client's identity by verifying the client's digital certificate with the public key for the CA that issues the personal certificate to the client ......"

I understand this to mean that if client authentication is all I want, I do not need to have the client certificate on the server's keystore as long as I have the certificate from the CA that signed the client's certificate.

Thus in my server queue manager keystore I have my "CA" certificate and the queue manager's certificate. This should suffice, shouldn't it. OR is the manual wrong?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Problems with SSL for MQ client connection
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.