试图通过java客户端访问MQ 7.5服务器,但出现错误,已创建SYSTEM.SSL.SVRCONN

试图通过java客户端访问MQ 7.5服务器,但出现错误,已创建SYSTEM.SSL.SVRCONN,java,ssl,ibm-mq,mq,Java,Ssl,Ibm Mq,Mq,没有SSL,我可以连接,但使用SSL,它会在MQ日志中抛出以下错误 AMQ9660: SSL key repository: password stash file absent or unusable. EXPLANATION: The SSL key repository cannot be used because MQ cannot obtain a password to access it. Reasons giving rise to this error include: (

没有SSL,我可以连接,但使用SSL,它会在MQ日志中抛出以下错误

AMQ9660: SSL key repository: password stash file absent or unusable.

EXPLANATION:
The SSL key repository cannot be used because MQ cannot obtain a password to
access it. Reasons giving rise to this error include: 
(a) the key database file and password stash file are not present in the
  location configured for the key repository, 
(b) the key database file exists in the correct place but that no password
  stash file has been created for it, 
(c) the files are present in the correct place but the userid under which MQ is
  running does not have permission to read them, 
(d) one or both of the files are corrupt. 

The channel is '????'; in some cases its name cannot be determined and so is
shown as '????'. The channel did not start.
ACTION:
Ensure that the key repository variable is set to where the key database file
is. Ensure that a password stash file has been associated with the key database
file in the same directory, and that the userid under which MQ is running has
read access to both files. If both are already present and readable in the
correct place, delete and recreate them. Restart the channel. 
----- amqccisa.c : 5577 -------------------------------------------------------
6/30/2015 12:15:33 - Process(14120.5) User(locahost) Program(amqrmppa.exe)
                      Host(localhost) Installation(Installation1)
                      VRMF(7.5.0.2) QMgr(QM1)

AMQ9492: The TCP/IP responder program encountered an error.
以下是产生错误的代码:

import javax.jms.JMSException;
import javax.jms.Session;

import com.ibm.mq.*;
import com.ibm.jms.JMSMessage;
import com.ibm.jms.JMSTextMessage;
import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQQueue;
import com.ibm.mq.jms.MQQueueConnection;
import com.ibm.mq.jms.MQQueueConnectionFactory;
import com.ibm.mq.jms.MQQueueReceiver;
import com.ibm.mq.jms.MQQueueSender;
import com.ibm.mq.jms.MQQueueSession;

import java.io.*;

import javax.net.ssl.*;

import java.net.ServerSocket;
import java.net.Socket;
import java.security.KeyStore;
/**
 * simple testcase for Point-to-point messaging .
 */
public class MQTEST {
  /**
   * Main method
   *
   * @param args
   */
  public static void main(String[] args) {
    try {
        SSLContext context = SSLContext.getDefault();
        System.setProperty("javax.net.ssl.trustStore","D:\\IBM\\CERT\\truststore.jks");
         System.setProperty("javax.net.ssl.keyStore","D:\\IBM\\Websphere\\Qmgrs\\QM1\\ssl\\key.kdb");
       System.setProperty("javax.net.ssl.keyStorePassword","password");





      MQQueueConnectionFactory cf = new MQQueueConnectionFactory();

      // Config
      cf.setHostName("localhost");
      cf.setPort(1414);
      cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
      cf.setQueueManager("QM1");
     cf.setChannel("SYSTEM.SSL.SVRCONN");
    // cf.setChannel("SYSTEM.DEF.SVRCONN");

     cf.setSSLCipherSuite("TLS_RSA_WITH_AES_128_CBC_SHA");



      MQQueueConnection connection = (MQQueueConnection) cf.createQueueConnection();


      MQQueueSession session = (MQQueueSession) connection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
      MQQueue queue = (MQQueue) session.createQueue("queue:///LQ1");
      MQQueueSender sender =  (MQQueueSender) session.createSender(queue);

队列管理器使用的密钥存储库的存储文件可能已损坏。在这种情况下,我所做的是:

1) 删除隐藏文件

2) 在IBM密钥管理实用程序中打开密钥存储库

3) 使用
密钥数据库文件/stash Password
菜单再次创建新的存储文件

然后再次尝试连接

您的客户端应用程序代码正在使用
.kdb
javax.net.ssl.keyStore
键入密钥存储库。据我所知,MQ Java客户端将只使用
.jks
类型的密钥存储。
.kdb
类型密钥存储由队列管理器和非Java客户端(如C/C)使用#


HTH

问题的错误日志格式和措辞表明,队列管理器无法访问其KDB密钥库

(注意:提供错误日志时,请告诉我们您是从QMgr还是从客户端获得的!“MQ日志”可以是任何一种方式。)

记住这一点,您应该运行设置队列管理器证书的设置过程。这包括:

  • 指定“隐藏密码”选项生成空KDB文件
  • 生成自签名证书或证书签名请求(CSR)
  • 如果这是针对CA签名的证书

  • 签署CSR
  • 将证书颁发机构的签名者证书导入QMgr的KDB和客户端密钥库
  • 将已签名的CSR接收到密钥库中
  • 如果这是自签名证书

  • 提取自签名证书的公共部分
  • 将自签名证书导入客户端的密钥库
  • 如果您忽略了这些步骤中的任何一个,请从您停止的地方继续

    如果忘记隐藏密码或隐藏文件已损坏,请使用iKeyman GUI或
    runmqakm
    命令的相应选项重新创建密码

    注意,如果KDB完全不存在,QMgr仍然抛出上面的错误。这是因为它做的第一件事就是尝试打开隐藏文件。如果找不到密码,则抛出
    密码隐藏文件不存在或不可用
    错误。即使从未创建过KDB,这也是事实