【发布时间】:2019-01-31 07:34:51
【问题描述】:
我是 JAVA 新手,在 Web Service Client 项目中使用 web service(.wsdl)。我在 jrd 中的 java cacerts 商店中导入客户端证书。我的代码如下:
System.setProperty("javax.net.ssl.trustStore","[PATH]/cacerts.jks");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
ServicesProxy service = new ServicesProxy();
ServiceRequest request = new ServiceRequest(1498);
ServiceResponse response = service.getDetails(request);
我握手失败,出现以下异常:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
我不知道为什么会有例外。任何帮助将不胜感激。
【问题讨论】:
-
那是使用 Apache CXF 作为 Web 服务客户端吗?这在
cxf.xml文件中使用了自己的 SSL 设置 - 更多详细信息 here -
您确定您的信任库的名称是
cacerts.jks而不仅仅是cacerts? -
我也尝试过使用 cacerts。
标签: java web-services soap