没有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);
发布于 2015-06-30 16:06:02
该问题的错误日志格式和措辞表明,队列管理器无法访问其KDB密钥库。
(注意:在提供错误日志时,请让我们知道您是从QMgr还是从客户端获得的!"MQ log“可以是任何一种方式。)
考虑到这一点,您应该运行配置队列管理器证书的设置过程。这包括:
的“隐藏密码”。
如果这是用于CA签名的证书...
中。
如果这是用于自签名证书...
中
如果您省略了这些步骤中的任何一步,请从您停止的地方继续。
如果忘记隐藏密码或存储文件已损坏,请使用iKeyman图形用户界面或runmqakm
命令的相应选项重新创建它。
注意,如果KDB完全不存在,QMgr仍然会抛出上面的错误。这是因为它做的第一件事就是尝试打开stash文件。如果它找不到它,则抛出password stash file absent or unusable
错误。即使在没有创建KDB的情况下也是如此。
发布于 2015-06-30 14:38:22
队列管理器使用的密钥存储库的隐藏文件可能已损坏。在这种情况下,我所做的是:
1)删除存放文件。
2)在IBM key Management Utility中打开密钥存储库。
3)使用Key Database File/Stash Password
菜单重新创建一个新的存储文件。
然后再次尝试连接。
您的客户端应用程序代码正在使用javax.net.ssl.keyStore
的.kdb
类型密钥库。据我所知,MQ客户端将只使用.jks
类型的密钥存储。Java型密钥存储由队列管理器和C/C#等非.kdb
客户端使用。
HTH
https://stackoverflow.com/questions/31132858
复制相似问题