【问题标题】:Apache Camel, Client CertificatesApache Camel,客户端证书
【发布时间】:2013-05-25 06:52:17
【问题描述】:

我正在尝试找到一种通过 Apache Camel 附加客户端证书的优雅方法。它可以是 Java 或 Spring XML。

我要发送到的所有服务器都有服务器证书,可以加密流量,但我需要在发送前将客户端公共证书附加到消息中。服务器包含 15 个左右的证书及其对应的私钥。

我的主要配置是用 Spring XML 编写的,所以我不确定如何通过添加客户端证书来实现它。

(我是一个 .NET 人,Java 经验最少,Linux 经验为 0)

示例弹簧:

<camel:route>          
    <camel:from uri="direct:GetEligibility"/>
    <camel:doTry>                   
        <camel:choice>
            <camel:when>
                <camel:xpath>count(//soapenv:Envelope) = '0'</camel:xpath>
                <camel:to uri="xslt:xslt/WrapSoap.xsl"/>
            </camel:when>
        </camel:choice>   
        <camel:setHeader headerName="CamelHttpMethod">
            <camel:constant>POST</camel:constant>
        </camel:setHeader>

        <camel:setHeader headerName="Content-Type">
            <camel:constant>text/xml; charset=utf-8</camel:constant>
        </camel:setHeader>     

        <camel:to uri="https://testsite.gov.ca/Services.Secured/FICR_AR022001.asmx"/>        

        <camel:doCatch>
            <camel:exception>java.lang.Exception</camel:exception>
            <camel:bean ref="log" method="error"/>
        </camel:doCatch>
    </camel:doTry>                
</camel:route>    

【问题讨论】:

    标签: java xml spring apache-camel


    【解决方案1】:

    您需要预先配置一组 SSLContextParameters,然后您可以将所需的任何证书添加到 http 端点。您可以选择使用不同的证书路由到不同的端点。

    在 Camel 文档 here 中有描述:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-20
      • 2019-07-15
      • 1970-01-01
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      • 2013-01-20
      相关资源
      最近更新 更多