当前位置: 首页 > 知识库问答 >
问题:

detailedJMSException:JMSWMQ0018:连接模式为“YYY”、主机名为“ZZZ”的队列管理器“XXX”连接失败

仲孙奇
2023-03-14

JMS应用程序需要七个参数才能与这里给出的MQ系列进行成功的SSL连接,https://github.com/ibm-messaging/mq-tls-ssl-wizard/blob/master/com.ibm.MQ.ssl-wizard/sample/sslsamplejms.java

我试图解释这些参数,

>

  • conname-服务器队列管理器的连接名,格式与MQSC DEFINE CHANNEL命令上的CONNAME参数相同,但没有指定端口。

    • 我想这是主机名
      null
    • 我正在使用SSL_RSA_WITH_AES_256_CBC_SHA.

    SSLKeyr-单个存储的名称,它既是keystore又是truststore。
    我使用mycertfile.cert生成了myjksfile.jks,使用mypassword和以下命令生成了myjksfile.jks,并在程序中以“c:\users\abc\myjksfile.jks”的形式提供了该文件的路径,

    • keytool-import-trustcacerts-keystore myjksfile.jks-storepass changeit-noprompt-alias ibmWebSphereMQUTQX-file c:\mqlib\mycertfile.cert

    SSLKeyrPassword-SSL密钥存储库密码,我用来生成myjksfile.jks文件的密码

    使用这七个参数运行上面的程序会导致此异常

    com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to     
    queue manager 'XXXX' with connection mode 'Client' and host name   
    'xxxx.yyyyyy.com(XXXXX)'.Check the queue manager is started and if running in
    client mode, check there is a listener running. Please see the linked  
    exception for more information. at  
    com.ibm.msg.client.wmq.common.internal.Reason.reasonToException
    (Reason.java:580) at  
    com.ibm.msg.client.wmq.common.internal.Reason.createException
    (Reason.java:216) at com.ibm.msg.client.wmq.internal.WMQConnection.<init> 
    (WMQConnection.java:431) at  
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.
    createV7ProviderConnection(WMQConnectionFactory.java:6789) at  
    com.ibm.msg.client.wmq.factories.WMQConnectionFactory.
    createProviderConnection(WMQConnectionFactory.java:6157)
    at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.
    createConnection(JmsConnectionFactoryImpl.java:285)
    at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection
    (MQConnectionFactory.java:6126) at      
    com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection 
    (MQQueueConnectionFactory.java:115) at  
    SSLSampleJMS.runSample(SSLSampleJMS.java:176)
    at SSLSampleJMS.main(SSLSampleJMS.java:135)
    Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with
    compcode '2' ('MQCC_FAILED') reason '2393' ('MQRC_SSL_INITIALIZATION_ERROR').
    at com.ibm.msg.client.wmq.common.internal.Reason.createException
    (Reason.java:204)... 8 more
    Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9204: Connection to
    host 'xxxx.yyyyyy.com(XXXXX)' rejected.
    [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2393;AMQ9771: SSL handshake failed.
    [1=java.lang.IllegalArgumentException[Cannot support
    SSL_RSA_WITH_AES_256_CBC_SHA with currently installed   
    providers],3=xxxx.yyyyyy.com/XX.XXX.XXX.XXX:XXXXX (xxxx.yyyyyy.com),4=SSLSocket.createSocket,5=default]],3=xxxx.yyyyyy.com(XXXXX),5=RemoteTCPConnection.makeSocketSecure]
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:2098)
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1347)
    at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:350)
    ... 7 more
    Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9771: SSL handshake
    failed. [1=java.lang.IllegalArgumentException[Cannot support
    SSL_RSA_WITH_AES_256_CBC_SHA with currently installed   
    providers],3=xxxx.yyyyyy.com/XX.XXX.XXX.XXX:XXXXX
    (xxxx.yyyyyy.com),4=SSLSocket.createSocket,5=default]
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure
    (RemoteTCPConnection.java:2001) at com.ibm.mq.jmqi.remote.impl.
    RemoteTCPConnection.connnectUsingLocalAddress(RemoteTCPConnection.java:855)
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.protocolConnect
    (RemoteTCPConnection.java:1262) at 
    com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect
    (RemoteConnection.java:714) at  
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.
    getSessionFromNewConnection(RemoteConnectionSpecification.java:356)
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.
    getSession(RemoteConnectionSpecification.java:265)
    at com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.
    getSession(RemoteConnectionPool.java:144)
    at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect(RemoteFAP.java:1709)
    ... 9 more
    Caused by: java.lang.IllegalArgumentException: Cannot support
    SSL_RSA_WITH_AES_256_CBC_SHA with currently installed providers
    at com.ibm.jsse2.o.<init>(o.java:29)
    at com.ibm.jsse2.as.setEnabledCipherSuites(as.java:5)
    at com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.makeSocketSecure
    (RemoteTCPConnection.java:1994)
    ... 16 more
    Process finished with exit code 0
    
  • 共有1个答案

    金正阳
    2023-03-14

    上述异常是由于在JMS clint端使用了错误的密码套件造成的。我在客户端使用SSL_RSA_WITH_AES_256_CBC_SHA密码套件,并获得了“java.lang.IllegalArgumentException[not support SSL_RSA_WITH_AES_256_CBC_SHA with current installed
    providers”。在JMS客户端使用正确的密码套件(TLS_RSA_WITH_AES_256_CBC_SHA)使JMS客户端和MQ系列之间的握手成功。参考:http://www-01.ibm.com/support/docview.wss?uid=SWG1IV66840

     类似资料: