【发布时间】:2016-11-20 11:15:52
【问题描述】:
在我运行以下代码的地方出现错误:
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
我尝试将证书添加到 JDK 的 CAcerts 密钥库,但错误没有改变。他们无论如何要弄清楚它正在从哪个密钥库中读取?还是这个问题是别的什么?
public static void main(String args[]) throws Exception {
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
String url = "https://www.mywebservice.com/ws";
SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(),url);
// print SOAP Response
System.out.print("Response SOAP Message:");
soapResponse.writeTo(System.out);
soapConnection.close();
}
谢谢您,我很乐意提供所需的任何其他详细信息。
【问题讨论】: