简体   繁体   English

Axis2客户端无法在Tomcat 7.0.42上发起第二个https调用

[英]Axis2 client is unable to initiate a second https call on Tomcat 7.0.42

I am trying to migrate an Java Axis2 client from Websphere6/JRE1.5.x to Tomcat 7.0.42/JRE1.6.x on Solaris. 我正在尝试将Java Axis2客户端从Websphere6 / JRE1.5.x迁移到Solaris上的Tomcat 7.0.42 / JRE1.6.x。 In the process, I have come across a issue where the client can communicate with a webservice through https the first time, but would fail from the second attempt onwards due to ssl errors. 在此过程中,我遇到了一个问题,即客户端可以第一次通过https与Web服务进行通信,但是由于ssl错误而导致第二次尝试失败。

Extracted from the log of the failed attempts showed - 从失败尝试的日志中提取的内容显示-

%% Client cached [Session-1, SSL_RSA_WITH_RC4_128_MD5] %%客户端缓存了[会话1,SSL_RSA_WITH_RC4_128_MD5]
%% Try resuming [Session-1, SSL_RSA_WITH_RC4_128_MD5] from port 34092 %%尝试从端口34092恢复[Session-1,SSL_RSA_WITH_RC4_128_MD5]
* * ClientHello, TLSv1 * * ClientHello,TLSv1
... ...
Thread-606, WRITE: TLSv1 Handshake, length = 179 线程606,写:TLSv1握手,长度= 179
Thread-606, READ: TLSv1 Alert, > length = 2 线程606,读取:TLSv1警报,>长度= 2
Thread-606, RECV TLSv1 ALERT: fatal, unexpected_message 线程606,RECV TLSv1警报:致命,意外消息

and the actual exception was (I suspect it was due to no open socket)- 而实际的例外是(我怀疑这是由于没有打开插座)-

Caused by: javax.net.ssl.SSLException: Received fatal alert: unexpected_message at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source) 由以下原因引起:javax.net.ssl.SSLException:收到致命警报:com.sun.net.ssl.internal.ssl.Alerts.getSSLException(意外来源)上出现意外消息
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source) com.sun.net.ssl.internal.ssl.Alerts.getSSLException(未知来源)com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(未知来源)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source) at java.io.BufferedOutputStream.flushBuffer(Unknown Source) at java.io.BufferedOutputStream.write(Unknown Source) at java.io.FilterOutputStream.write(Unknown Source) at org.apache.commons.httpclient.WireLogOutputStream.write(WireLogOutputStream.java:86) at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:89) com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(未知源)com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(未知源)com.sun.net.ssl.internal com.sun.net.ssl.internal.ssl.AppOutputStream.write(未知源)的java.io.BufferedOutputStream.flushBuffer(java.io.BufferedOutputStream.write处的.ssl.SSLSocketImpl.writeRecord(未知源) (来源不明),位于org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(org.apache.commons.httpclient.WireLogOutputStream.write(WireLogOutputStream.java:86) AxisRequestEntity.java:89)

Comparing this to the logs on the Websphere environment, I have found a couple of differences and hence my questions - 将其与Websphere环境中的日志进行比较,我发现了一些差异,因此我的问题是-

  1. Is SSL configuration on the Tomcat going to affect the behaviour of a Axis2 client calling a different server? Tomcat上的SSL配置是否会影响Axis2客户端调用其他服务器的行为? Or is my issue more at the OS level? 还是我的问题更多在操作系统级别?

  2. on the old environment, I have noticed more than one ssl sessions were cached. 在旧环境中,我注意到缓存了多个ssl会话。 When resume failed on one session, it simply tried using a different session and continued with the call. 当恢复在一个会话上失败时,它只是尝试使用另一个会话并继续进行呼叫。 On the new server, however, I have ever only seen one session created and was cached. 但是,在新服务器上,我只看到一个会话被创建并被缓存。 When resuming, it kept trying to resume the same sessionn a different port but kept failing. 恢复时,它一直尝试在不同端口上恢复相同的会话,但一直失败。 As it was the only session, if couldn't try a different session nor creating a new session. 因为这是唯一的会话,所以如果无法尝试其他会话或创建新会话。 My question is why is there only one session created and is it a configuration issue to enable caching of more than one sessions? 我的问题是为什么只创建一个会话,并且是否可以缓存多个会话是一个配置问题?

Any help/pointers are greatly appreciated. 任何帮助/指针,我们将不胜感激。

Finally tracked down the fault. 终于找到了故障所在。 Thought I would share it here for anyone that may come across a similar issue. 以为我会在这里为可能遇到类似问题的任何人分享。 As it turned out, it has to do with the Security Provider on the JRE itself. 事实证明,它与JRE本身上的安全提供程序有关。 Here is a link on how to configure it - 这是有关如何配置它的链接-
http://pic.dhe.ibm.com/infocenter/ssp/v3r4/index.jsp?topic=%2Fcom.ibm.help.sspreleasenotes.doc%2FSSP_RN_RemovePKCS11SecurityProvider.html http://pic.dhe.ibm.com/infocenter/ssp/v3r4/index.jsp?topic=%2Fcom.ibm.help.sspreleasenotes.doc%2FSSP_RN_RemovePKCS11SecurityProvider.html

It seemed the default security provider on Solaris was causing the weird behaviour I saw. 看来Solaris上的默认安全提供程序正在引起我所看到的奇怪行为。 Following the instruction in the link, and by using the Java default provider, resolved the ssl problem I saw. 按照链接中的说明,并使用Java默认提供程序,解决了我看到的ssl问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM