2015-04-22 133 views
0

我们正在使用Camel CXF API与安全服务器进行通信。这是双向SSL,我们正在通过Netscaler与3个不同的系统交谈。 2系统公开SOAP WS,我们能够建立双向SSL和交换消息。第三个系统暴露了REST API,并且在SSL握手中给出了一个非常奇怪的问题。当我们在保险丝中使用骆驼CXF时会发生错误。在其自己的JVM中运行的独立Java程序能够成功与REST服务通话。Camel CXF Rest SSL握手错误

我们启用了SSL调试标志,并在日志中获得以下错误。

Camel thread #0 - timer://foo, WRITE: TLSv1 Change Cipher Spec, length = 1 
Camel thread #0 - timer://foo, handling exception: java.net.SocketException: Connection reset 
%% Invalidated: [Session-11, SSL_RSA_WITH_RC4_128_MD5] 
Camel thread #0 - timer://foo, SEND TLSv1 ALERT: fatal, description = unexpected_message 
Camel thread #0 - timer://foo, WRITE: TLSv1 Alert, length = 2 
Camel thread #0 - timer://foo, Exception sending alert: java.net.SocketException: Broken pipe 
Camel thread #0 - timer://foo, called closeSocket() 

这是Camel REST svc中的配置。

<!-- Key Manager & Trust Manager --> 
<bean id="keyManagersBean" 
      class="test.IntegrationKeyManagerFactory" 
      factory-method="getKeyManager"> 
    <argument value="${security.keystorepassword}"/> 
    <argument value="${security.keystorelocation}"/> 
</bean> 

<bean id="trustManagersBean" 
     class="test.IntegrationKeyManagerFactory" 
     factory-method="getTrustManager"> 
    <argument value="${security.keystorepassword}"/> 
    <argument value="${security.keystorelocation}"/> 
</bean> 

<!-- ==================== security configuration =================== --> 
<http:conduit name="*.http-conduit"> 
    <http:tlsClientParameters> 
     <sec:keyManagers ref="keyManagersBean"/> 
     <sec:trustManagers ref="trustManagersBean"/> 
    </http:tlsClientParameters> 
</http:conduit> 

<!-- ====================== Camel Context & Routes ====================== --> 
<camel:camelContext id="camel.test.context"> 
    <camel:route id="testRoute"> 
     <camel:from uri="timer://foo?fixedRate=true&amp;period=30s" /> 
     <camel:transform> 
      <camel:constant>""</camel:constant> 
     </camel:transform> 
     <camel:removeHeaders pattern="CamelCxfMessage" /> 
     <camel:setHeader headerName="Exchange.HTTP_METHOD"> 
      <camel:constant>GET</camel:constant> 
     </camel:setHeader> 
     <camel:to uri="cxfrs:{{protocol}}://{{host}}:{{port}}/{{context}}/getList" /> 
     <camel:log message="${body}"/> 
    </camel:route> 
</camel:camelContext> 

有谁知道可能是什么问题?完全相同的配置适用于通过netscaler与SOAP WS进行通信,但不能通过netscaler与REST WS进行通信。

+0

在我们发现由于某种原因TLSClientParameters在HTTP Conduit中为null的问题上取得了一些进展。任何可能发生这种情况的原因? – user451445

回答

0

我能通过从camel cxf rsClient切换到使用plain camel-http调用来解决此问题。但认为使用HttpConduit与cxfrsClient有一些问题。