使用cxf wsdl2java进行客户端证书身份验证

时间:2017-06-14 13:07:27

标签: java web-services cxf

我使用cxf wsdl2java生成了java类。但不确定如何使用客户端证书对请求进行身份验证。通过使用以下命令,我能够从wsdl生成客户端类,没有任何问题:

wsdl2java -ant - client -d D:\cxf-client D:\HelperActions.wsdl

我在谷歌搜索中获得了具有用户ID和密码身份验证的博客或论坛。但无法找到如何使用jks或.crt证书对请求进行身份验证。

我尝试了以下链接中提到的内容

https://db-blog.web.cern.ch/blog/luis-rodriguez-fernandez/2014-07-java-soap-client-certificate-authentication

我也尝试实施以下链接中提到的认证

http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/ClientNonSpring.java?revision=1406329&view=markup

但我收到以下异常

javax.xml.ws.webserviceException:org.apache.cxf.service.factory.ServiceConstructionException:无法创建服务

引起:javax.wsdl.WSDLException:WSDLException:faultCode = PARSER_ERROR:解析问题' wsdl路径'。:javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径构建failes:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径

引起:javax.net.ssl.HandshakeException:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径

引起:sun.security.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径。

引起:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径

我将证书放在类路径中,我尝试了上述链接中提到的两种方法,但所有的努力都没有奏效。我不知道我哪里出错了。

有人可以帮我发送带有客户证书的请求吗?

0 个答案:

没有答案