我正在尝试为我也写过的基于CXF的Web服务实现客户端.
我的Web服务运行良好(通过soapUI测试工作正常),但运行客户端失败,并出现以下情况:
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323)
该消息明确指出了证书问题,因此我进行了快速搜索,找到了正确的supporting SSL in CXF方法,并将以下内容添加到我的Spring应用程序上下文配置XML中:
file="my/file/dir/Morpit.jks"/>
file="my/file/dir/Truststore.jks"/>
.*_EXPORT_.*
.*_EXPORT1024_.*
.*_WITH_DES_.*
.*_WITH_AES_.*
.*_WITH_NULL_.*
.*_DH_anon_.*
Betty
password
并重建了客户端.客户端构建成功但我仍然得到相同的确切错误和完全相同的堆栈跟踪,就好像我从未添加过这个http:conduit的东西.
我还没有将证书添加到商店,并且商店的路径不正确,但这是故意的,因为我只是想看看重建的客户端如何报告此问题,调整到新的http:管道信息.
相反,我惊讶地发现它完全被忽略了.
我错过了什么?
接近这个的正确方法是什么?
更新:我刚刚注意到我的applicationcontext.xml以http:conduit为下划线,显示以下错误消息:
The prefix "http" for element "http:conduit" is not bound.
所以我做了一个快速搜索,发现a thread表明:
The client needs to configure the HTTP conduit with the keystore that
contains the certificate of the STS, e.g.:
这加强了@GreyBeardedGeek所写的内容.现在去work on this ……