title: Connecting to IBM MQ over SSL via .net client
body: <p>I am trying to connect to a MQ server queue via a .NET client. I need to use the certificate for secured communication. Here is the code that I have:</p>
  
  <pre><code>MQEnvironment.SSLKeyRepository = "*SYSTEM";
  MQEnvironment.ConnectionName = connectionName;
  MQEnvironment.Channel = channelName;
  MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
  MQEnvironment.SSLCipherSpec = "TLS_RSA_WITH_AES_256_CBC_SHA"; 
  
  queueManager = new MQQueueManager(queueManagerName, channelName, connectionName);
  
  queue = queueManager.AccessQueue(SendQueueName,MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
  queueMessage = new MQMessage();
  queueMessage.WriteString(message);
  queueMessage.Format = MQC.MQFMT_STRING;
  queue.Put(queueMessage, new MQPutMessageOptions());
  </code></pre>
  
  <p>Every time I try to put the message on the queue, I get this error message</p>
  
  <pre><code>Reason Code: 2059
  MQexp.Message: MQRC_Q_MGR_NOT_AVAILABLE
  </code></pre>
  
  <p>I have checked my variables for the queue manager name, queue name etc and they are correct. 
  I was also able to connect to a different queue without SSL, I believe that my code is not furnishing enough information to establish a successful connection.</p>
  
  <p>Any help on this would be appreciated.</p>
  
  <p>Thanks,
  Kunal</p>