2015-04-22 57 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有一些問題。