【问题标题】:Specify SSLContext for SOAP Client Using Apache CXF使用 Apache CXF 为 SOAP 客户端指定 SSLContext
【发布时间】:2016-11-02 19:02:33
【问题描述】:

所以我们有一个 SOAP 客户端一直在工作,而客户最近将服务器切换到使用带有自签名证书的 SSL。现在我试图弄清楚如何让我们的客户端使用正确的 SSL 上下文。我发现了一个相关的问题here;但我不知道如何将它与我的代码联系起来(相关部分总结如下 - DCAMethods[Soap] 是一个 cxf 生成的接口)。

File tmp = cacheWsdl(UUID.randomUUID().toString(), new URL(wsdlLocation), anzoSSLContext);
// It would be useful to specify the SSLContext here, but I am working around that.
DCAMethods methods = new DCAMethods(tmp.toURI().toURL()); 
DCAMethodsSoap soapInterface = methods.getDCAMethodsSoap();
// Need to specify the SSLContext for this call.
String rawXmlData = (String) soapInterface.getCopy(connectionId, username, password, documentVersionId, rendition); 

【问题讨论】:

    标签: java soap cxf soap-client


    【解决方案1】:

    我假设您需要 SSL 和两种身份验证方式,而不是对 SOAP 消息进行签名

    CXF 自己支持使用客户端证书的 SSL 连接。它使用 Java SSLContext,但所有配置都是通过 CXF 配置文件完成的

    在步骤 4 中查看我的回答 https://stackoverflow.com/a/37610607/6371459,以查看如何使用 spring 文件或以编程方式配置 CXF。 SSL 支持的完整文档是here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-18
      • 2014-08-21
      • 1970-01-01
      相关资源
      最近更新 更多