title: Connecting to WebSphere MQ 7.0 using JMS through SSL
body: <p>I'm preparing a test environment to connect to Websphere MQ 7.0 through SSL, so I have to configure SSL on Websphere MQ myself before I start <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0510_fehners/0510_fehners.html" rel="nofollow">configuring the SSL connection from JMS side</a>.</p>
  
  <p>So, I'm trying to create SSL certificates for Websphere MQ, following <a href="http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/bp10610_.htm" rel="nofollow">these</a> steps. But when I attempt to add the signed certificate to the repository using the command <code>gsk7cmd.exe -cert -receive -db key.kdb -pw pass -file QMANAGER_signed.arm</code> I get the error:</p>
  
  <pre><code>An attempt to receive the certificate has failed.
  All the signer certificates must exist in the key database.
  </code></pre>
  
  <p>I even tried the C command <code>gsk7capicmd</code> but it also fails, with the error:</p>
  
  <pre><code>Error: 146
  
  Error id: GSKKM_ERR_INVALID_CERT_CHAIN
  Details: QMANAGER_signed.arm
  </code></pre>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>I used the WMQ SSL Wizard to create the proper configuration. The configuration went smoothly, but when I run the JMS sample included with the SSL Wizard I get the error: <code>MQJE001: Completion Code '2', Reason '2397'</code>
  the SSL logs (using the option <code>-Djavax.net.debug=all</code>) shows the following error:</p>
  
  <pre><code>Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2397;AMQ9771: SSL handshake failed. [1=javax.net.ssl.SSLHandshakeExcep
  tion[Remote host closed connection during handshake],3=localhost/127.0.0.1:1414 (localhost),4=SSLSocket.startHandshake,5
  =default]
          at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:995)
          at com.ibm.mq.jmqi.remote.internal.system.RemoteConnection.connect(RemoteConnection.java:989)
          at com.ibm.mq.jmqi.remote.internal.system.RemoteConnectionPool.getConnection(RemoteConnectionPool.java:293)
          at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1371)
          at com.ibm.msg.client.wmq.internal.WMQConnection.&lt;init&gt;(WMQConnection.java:331)
          ... 7 more
  Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
          at com.ibm.jsse2.jc.a(jc.java:380)
          at com.ibm.jsse2.jc.g(jc.java:115)
          at com.ibm.jsse2.jc.a(jc.java:240)
          at com.ibm.jsse2.jc.startHandshake(jc.java:54)
          at com.ibm.mq.jmqi.remote.internal.RemoteTCPConnection.protocolConnect(RemoteTCPConnection.java:989)
          ... 11 more
  Caused by: java.io.EOFException: SSL peer shut down incorrectly
          at com.ibm.jsse2.a.a(a.java:7)
          at com.ibm.jsse2.jc.a(jc.java:493)
          ... 15 more
  </code></pre>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>Using T.Rob's diagnostic technique mentioned in his answer, I'm still stuck at point #3 with the same error as before.</p>