我是JAVA的新手,我正在Web服务客户端项目中使用(.wsdl)消费Web服务。我将客户端证书导入到jrd中的Javacacerts存储中。我的代码如下:
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
我不知道为什么会有异常。希望能得到帮助。
cxf.xml
文件中使用自己的SSL设置 - 更多细节请参见此处。 - df778899cacerts.jks
而不仅仅是cacerts
吗? - Prasann