1

我需要使用 CXF Spring 配置创建 SSL 安全 Web 服务客户端,我想知道如何告诉 CXF 使用我的密钥库中的客户端证书?我需要在 WEB-INF 下创建 cxf.xml 文件吗?如果是的话,我应该在那里包括什么?

我只需要客户端,因为服务器端是我正在连接的第 3 方提供商。

我的 pom 中确实有以下依赖项

 <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>${cxf.version}</version>
    </dependency>

谢谢!

4

2 回答 2

0

我有同样的问题,没有找到配置它的弹簧方式。所以我这样

于 2013-04-27T01:00:24.220 回答
0

http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport%28includingSSLsupport%29-ConfiguringSSLSupport怎么样

<http:conduit name="{http://apache.org/hello_world}HelloWorld.http-conduit">
<http:tlsClientParameters>
  <sec:keyManagers keyPassword="password">
    <sec:keyStore type="JKS" password="password"
                  file="my/file/dir/Morpit.jks"/>
  </sec:keyManagers>
  <sec:trustManagers>
    <sec:keyStore type="JKS" password="password"
                  file="my/file/dir/Truststore.jks"/>
  </sec:trustManagers>
  <sec:cipherSuitesFilter>
    <!-- these filters ensure that a ciphersuite with export-suitable or null encryption is used, but exclude anonymous Diffie-Hellman key change as
         this is vulnerable to man-in-the-middle attacks -->
    <sec:include>.*_EXPORT_.*</sec:include>
    <sec:include>.*_EXPORT1024_.*</sec:include>
    <sec:include>.*_WITH_DES_.*</sec:include>
    <sec:include>.*_WITH_AES_.*</sec:include>
    <sec:include>.*_WITH_NULL_.*</sec:include>
    <sec:exclude>.*_DH_anon_.*</sec:exclude>
  </sec:cipherSuitesFilter>
</http:tlsClientParameters>
<http:authorization>
  <sec:UserName>Betty</sec:UserName>
  <sec:Password>password</sec:Password>
</http:authorization>
<http:client AutoRedirect="true" Connection="Keep-Alive"/>
</http:conduit>
于 2013-07-10T22:11:51.530 回答