没有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);
答案 0 :(得分:1)
错误日志格式和问题的措辞表明它是队列管理器,无法访问其KDB密钥库。
(注意:提供错误日志时,如果您从QMgr或客户端获取错误日志,请告诉我们!“MQ日志”可以采用任何一种方式。)
考虑到这一点,您应该运行设置过程来配置队列管理器的证书。这包括:
如果这是用于CA签名的证书......
如果是自签名证书......
如果您省略了上述任何步骤,请选择离开的地方。
如果您忘记隐藏密码或存储文件已损坏,请使用iKeyman GUI或runmqakm
命令的相应选项重新创建密码。
请注意,如果KDB完全不存在,QMgr仍会抛出上述错误。这是因为它首先要尝试打开存储文件。如果找不到,则抛出password stash file absent or unusable
错误。即使没有创建过KDB,也是如此。
答案 1 :(得分:0)
队列管理器使用的密钥存储库的存储文件可能已损坏。在这种情况下我做的是:
1)删除存储文件。
2)在IBM Key Management Utility中打开密钥存储库。
3)使用./main
菜单再次创建一个新的存储文件。
然后再尝试连接。
您的客户端应用程序代码正在使用Key Database File/Stash Password
类型的.kdb
密钥存储库。据我所知,MQ Java客户端将仅使用javax.net.ssl.keyStore
类型的密钥库。 .jks
类型密钥库由队列管理器和非Java客户端(如C / C#
HTH