| Author | 
		  Message
		 | 
		
		  | mqnet | 
		  
		    
			  
				 Posted: Fri Apr 17, 2009 4:36 pm    Post subject: MQRC_SSL_INITIALIZATION_ERROR | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Sat Apr 18, 2009 10:26 am    Post subject: Re: MQRC_SSL_INITIALIZATION_ERROR | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqnet | 
		  
		    
			  
				 Posted: Sat Apr 18, 2009 1:16 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Sat Apr 18, 2009 2:07 pm    Post subject: Re: MQRC_SSL_INITIALIZATION_ERROR | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqnet | 
		  
		    
			  
				 Posted: Sat Apr 18, 2009 5:41 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Sun Apr 19, 2009 12:16 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqnet | 
		  
		    
			  
				 Posted: Mon Apr 20, 2009 8:16 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sagitwang | 
		  
		    
			  
				 Posted: Tue May 26, 2009 7:04 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Tue May 26, 2009 2:02 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				Yes I believe MQEnvironment is a static class. 
 
 
Have fun   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rekarm01 | 
		  
		    
			  
				 Posted: Tue May 26, 2009 3:16 pm    Post subject: Re: MQRC_SSL_INITIALIZATION_ERROR | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |