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 » IBM MQ API Support » MQRC_SSL_INITIALIZATION_ERROR

Post new topic  Reply to topic
 MQRC_SSL_INITIALIZATION_ERROR « View previous topic :: View next topic » 
Author Message
mqnet
PostPosted: Fri Apr 17, 2009 4:36 pm    Post subject: MQRC_SSL_INITIALIZATION_ERROR Reply with quote

Newbie

Joined: 24 Mar 2009
Posts: 6

Hello All,

I am using IBM Websphere MQ classes for .Net and trying to send a message from .Net to MQ using SSL.

1) I have installed MQ Client on my windows 2000 machine and used IBM Key Management Tool to create a key database file (kdb).
2) Created a self-signed certificate in the above created kdb.
3) Extracted the certificate and sent to MQ group to import on their end.
4) Received a certificate from MQ group and I added it to my .kdb.
5) Installed both the certificates on my windows 2000 machine
6) Stash the password for .kdb.

Then, I have the following in my VB .Net code.


'set the MQEnvironment values
qEnvironment.Hostname = hostName
qEnvironment.Port = port
qEnvironment.Channel = channel

'************************************************************
' FOR SSL
'************************************************************
qEnvironment.SSLCipherSpec = "RC4_SHA_US"
qEnvironment.SSLKeyRepository = "F:\installs\keys\rssmq" 'rssmq.kdb is stored in F:\installs\keys
qEnvironment.SSLPeerName = "CN=TRMGR, OU=IT, O=KP"
'************************************************************

'Create a connection to the queue manager using the connection properties just defined
Try
qMgr = New MQQueueManager(qManager)
System.Console.WriteLine("create of MQQueueManager successful")
Catch mqe As IBM.WMQ.MQException
System.Console.WriteLine("create of MQQueueManager ended with {0}", mqe.Message)
End Try


Then , I get the following error:
MQRC_SSL_INITIALIZATION_ERROR
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.


I read that SSLPeerName is an optional one. So, I tried without SSLPeerName and got below exception.

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at IBM.WMQ.MQClient.MQCONNX(String qMgrName, MQCNO& mqcno, Int32& pHconn, Int32& pCompCode, Int32& pReason)
at IBM.WMQ.MQClientConnector.MQCONNX(String qMgrName, MQConnectOptions& cno, Int32& hConn, Int32& compCode, Int32& reason)
at IBM.WMQ.MQQueueManager.Connect(String queueManagerName)
at IBM.WMQ.MQQueueManager..ctor(String queueManagerName)

Am I missing anything ? Can anyone please help me ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Sat Apr 18, 2009 10:26 am    Post subject: Re: MQRC_SSL_INITIALIZATION_ERROR Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqnet wrote:
Am I missing anything ? Can anyone please help me ?


That connection method doesn't support SSL. Check the Clients & Security manuals.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqnet
PostPosted: Sat Apr 18, 2009 1:16 pm    Post subject: Reply with quote

Newbie

Joined: 24 Mar 2009
Posts: 6

I read that SSL is supported with unmanaged client connections.
How do I speicify "unmanaged client connection" to MQ from my .Net 1.1 code ? Please guide me. Thanks in advance.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sat Apr 18, 2009 2:07 pm    Post subject: Re: MQRC_SSL_INITIALIZATION_ERROR Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
mqnet wrote:
Am I missing anything ? Can anyone please help me ?


That connection method doesn't support SSL. Check the Clients & Security manuals.


Eh?

There's no indication here that something has been done to set whether this is a managed connection or not.

Also, the error has nothing to do with the type of connection. "Object reference not set to an instance of an object" is purely a .NET programing level error... Perhaps it would be good to know that the right variables are properly initialized.
Back to top
View user's profile Send private message
mqnet
PostPosted: Sat Apr 18, 2009 5:41 pm    Post subject: Reply with quote

Newbie

Joined: 24 Mar 2009
Posts: 6

I have initialized all the variables in .net. Can anyone tell me what variable this error refers to?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Apr 19, 2009 12:16 am    Post subject: Reply with quote

Grand High Poobah

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

mqnet wrote:
I have initialized all the variables in .net. Can anyone tell me what variable this error refers to?

How pray did you initialize the MQEnvironment class ?
Your code shows qEnvironment but does not show how this is related to MQEnvironment!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqnet
PostPosted: Mon Apr 20, 2009 8:16 am    Post subject: Reply with quote

Newbie

Joined: 24 Mar 2009
Posts: 6

If I use,

Dim qEnvironment As MQEnvironment '* MQEnvironment instance
qEnvironment = New MQEnvironment

I get error,

'IBM.WMQ.MQEnvironment.Private Sub New() is not accessible in this context because it is Private'.

I think this is not causing my original 'object refernce' error. I have used the same code without SSL for MQEnvironment variable and it works perfectly.

It could be something related to SSL installaion. How do I verify SSL intallation is correct on my end ?

I have my self-signed certificate and certtificate signed by MQ Server in my "trusted root certification authorities". I am using windows 2000 with .net 1.1 ? Is there a way to check my SSL intallation is correct ? any ideas ?
Back to top
View user's profile Send private message
sagitwang
PostPosted: Tue May 26, 2009 7:04 am    Post subject: Reply with quote

Novice

Joined: 01 Dec 2008
Posts: 13

fjb_saper wrote:
mqnet wrote:
I have initialized all the variables in .net. Can anyone tell me what variable this error refers to?

How pray did you initialize the MQEnvironment class ?
Your code shows qEnvironment but does not show how this is related to MQEnvironment!


same question - is the MQEnvironment a static class? Do you need to init it?

I have got the same error, but it is stange, as the SSL key repository can be set in the environment variable, if I set it that way, then it is 2059, if set up as MQEnvironment.SSLKeyRepository = @"C:\SSLCertificates\key"; then init error ... no idea how to go around
BTW the ssl cipher value which I use is NULL_SHA
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue May 26, 2009 2:02 pm    Post subject: Reply with quote

Grand High Poobah

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

Yes I believe MQEnvironment is a static class.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Tue May 26, 2009 3:16 pm    Post subject: Re: MQRC_SSL_INITIALIZATION_ERROR Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

sagitwang wrote:
same question - is the MQEnvironment a static class? Do you need to init it?

More precisely, MQEnvironment is a class with static properties.

An application does not need to instantiate MQEnvironment, to get/set its properties.
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 » IBM MQ API Support » MQRC_SSL_INITIALIZATION_ERROR
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.