gpt4 book ai didi

ssl - Camel CXF Rest SSL 握手错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:55:34 24 4
gpt4 key购买 nike

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

我们已启用 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 通信。

最佳答案

我能够通过从 camel cxf rsClient 切换到使用普通的 camel-http 调用来解决这个问题。但是认为将 HttpConduit 与 cxfrsClient 一起使用存在一些问题。

关于ssl - Camel CXF Rest SSL 握手错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29808211/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com