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

WMQ JMS API SSL Sun JDK和SSL_RSA_WITH_AES_128_CBC_SHA

方鸿振
2023-03-14

如何让使用SSL_RSA_WITH_AES_128_CBC_SHA(在队列连接工厂中)的JMS客户端连接到使用TLS_RSA_WITH_AES_128_CBC_SHA的服务器

  • 客户端Sun JDK 7 WIN
  • 服务器IBM Power(i)
  • 服务器上的MQ 7.1版
  • 客户端上的MQ版本7.5.0.4
  • 与MQ Explorer的连接正常工作
  • 下面的代码与ibm JDK C:\Program Files\ibm\WebSphere MQ Explorer\jre\jre\bin
  • 下面的代码不能与“C:\Program Files\Java\JDK1.7.0_67\bin with Java Cryptography Extension(JCE)Unlimited Strength Registry Policy Files 7 Download installed

代码:

       // Instantiate the initial context
        String contextFactory = "com.sun.jndi.fscontext.RefFSContextFactory";
        Hashtable environment = new Hashtable();
        environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
        environment.put(Context.PROVIDER_URL, initialContextUrl);
        Context context = new InitialDirContext(environment);
        System.out.println("Initial context found!");

        String keystoreName = System.getProperty("javax.net.ssl.keyStore");
        System.out.println("keystoreName " + keystoreName + " canRead " + new File(keystoreName).canRead());
        String truststoreName = System.getProperty("javax.net.ssl.trustStore");
        System.out.println("truststoreName " + keystoreName + " canRead " + new File(truststoreName).canRead());


        // Lookup the connection factory
        JmsConnectionFactory cf = (JmsConnectionFactory) context.lookup(connectionFactoryFromJndi);


        System.out.println("CF = " + cf.getClass().getName());

        MQConnectionFactory mqcf = (MQConnectionFactory) cf;
        System.out.println("getSSLCipherSuite:" + mqcf.getSSLCipherSuite());
        System.out.println("getSSLSocketFactory:" + mqcf.getSSLSocketFactory());

        // Lookup the destination
        destination = (JmsDestination) context.lookup(destinationFromJndi);
        System.out.println("getSSLSocketFactory:" + mqcf.getSSLSocketFactory());

        // Create JMS objects
        connection = cf.createConnection();
        System.out.println("getSSLSocketFactory:" + mqcf.getSSLSocketFactory());

        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        System.out.println("getSSLSocketFactory:" + mqcf.getSSLSocketFactory());

        consumer = session.createConsumer(destination);
        System.out.println("getSSLSocketFactory:" + mqcf.getSSLSocketFactory());

        // Start the connection

        connection.start();
        System.out.println("getSSLSocketFactory:" + mqcf.getSSLSocketFactory());

给我:

 Initial context found!
keystoreName C:/Users/...key.jks canRead true
truststoreName C:/Users/.../key.jks canRead true
CF = com.ibm.mq.jms.MQConnectionFactory
getSSLCipherSuite:SSL_RSA_WITH_AES_128_CBC_SHA
getSSLSocketFactory:null
getSSLSocketFactory:null
keyStore is : C:/Users/.../key.jks
keyStore type is : jks
keyStore provider is : 
init keystore
init keymanager of type SunX509
***
found key for : ibmwebspheremquserid
.....
  Valid from Mon May 14 23:59:46 CEST 2012 until Thu May 14 23:59:46 CEST 2015

trigger seeding of SecureRandom
done seeding SecureRandom
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'qm' with connection mode 'Client' and host name 'host(1414)'.
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.
Inner exception(s):
com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2393' ('MQRC_SSL_INITIALIZATION_ERROR').
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9204: Connection to host 'host(1414)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Unsupported ciphersuite SSL_RSA_WITH_AES_128_CBC_SHA],3=host/host:1414 (10.20.28.12),4=SSLSocket.createSocket,5=default]],3=host(1414),5=RemoteTCPConnection.makeSocketSecure]
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2393;AMQ9771: SSL handshake failed. [1=java.lang.IllegalArgumentException[Unsupported ciphersuite SSL_RSA_WITH_AES_128_CBC_SHA],3=host/host:1414 (10.20.28.12),4=SSLSocket.createSocket,5=default]
java.lang.IllegalArgumentException: Unsupported ciphersuite SSL_RSA_WITH_AES_128_CBC_SHA
FAILURE

共有1个答案

公瑞
2023-03-14

切换到IBM JRE/JDK,它就可以工作了。

 类似资料:
  • 问题内容: 关于它们有很多传说。我想知道真相。以下两个示例之间有什么区别? 问题答案: 不确定从何处获得传说,但: 提交按钮 与: IE6将在标记之间提交此按钮的所有文本,其他浏览器将仅提交值。使用可使您在按钮的设计上享有更大的布局自由度。从各种意图和目的看,它乍一看似乎很棒,但是各种浏览器怪癖使它有时很难使用。 在您的示例中,IE6将发送到服务器,而其他大多数浏览器将不发送任何内容。要使其跨浏览

  • 什么区别以及如何正确重写代码?

  • 我试图理解为什么下面两个代码块会产生不同的结果。 代码块1按预期工作,并返回从数据库中查找的提供程序的数组。另一方面,代码块2返回函数数组。在理解promissione.all()和async/await时,我觉得缺少了一些简单的东西。 代码块的差异如下: > 块1:创建许诺函数数组,然后使用map运算符将其包装在异步函数中。 块2:许诺函数的数组被创建为异步函数。因此,不调用map运算符。 如果

  • 问题内容: 我才刚刚开始研究SQL。 我有一个SQL Server 2008r2数据库,它将返回两个字段DocDate和InvValue。我需要将InvValues汇总为今天的MTD和YTD,所以看起来像 我已经做了大量的Google搜寻,并且可以使用SUM&DATEPART进行一项或多项,但是我坚持尝试两者兼而有之。 有人可以给我一些伪代码,以帮助我进一步谷歌。 谢谢@戈登·利诺夫(Gordon

  • 这个示例代码来自一本Java书籍,从墙上的99瓶啤酒到没有啤酒打印出这首歌。问题是,当墙上是1瓶啤酒时,它仍然写着瓶子。我试图通过在末尾添加部分来解决这个问题。但是,它仍然显示1瓶啤酒在墙上,我瓶啤酒在墙上。 我不知道该改变什么来解决这个问题。是否创建另一个while部分? 如果你能给他们一个提示,这样我就可以自己解决它,那也很酷!因为我知道我的实际歌曲输出是在第一个if部分,但我不知道我应该在哪

  • 原文地址:https://cesiumjs.org/tutorials/cesium-and-webpack/ Cesium 和 Webpack Webpack是非常强大非常流行的JavaScript 模块打包工具。它可以让开发人员以一种简单直观的 require 方式去加载各种页面需要的文件,极大的方便了开源人员对代码和资源文件进行结构化设计。当编译的时候,它会跟踪代码依赖性,把所有的模型打包到

  • 问题内容: 我一直在学习redis和node.js。我有两个问题,找不到令人满意的答案。 我的第一个问题是关于在node.js中重用Redis客户端。我找到了这个问题和答案:如何在socket.io中重用Redis连接,但还不足以让我满意。 现在,如果我在连接事件中创建redis客户端,它将为每个连接生成。因此,如果我有2万个并发用户,那么将有2万个Redis客户端。 如果我将其放在连接事件之外,

  • 我需要控制日志框架的最大磁盘空间量。 例如,在log4j中,如果有如下所示的追加器,我可以很容易地估计需要多少磁盘空间: 对于maxFileSize和maxBackupIndex,我知道最多需要10x100KB。 我注意到DailyRollingFileAppender,但它不支持maxFileSize。 除了RollingFileAppender之外,是否还有其他fileappender可以实现