我正在尝试访问已从独立的java程序启用了SSL的web服务。我能够从WSDL生成客户端,但是当我尝试调用web服务时,我得到了SSL握手问题。下面是java代码
TestWebService sh = (TestWebService) shs.getTestWebServiceExportTestWebServiceHttpPort();
BindingProvider port = (BindingProvider)sh;
port.getRequestContext().put(BindingProvider.
ENDPOINT_ADDRESS_PROPERTY, args[0]);
System.out.println( ((BindingProvider)sh).toString() );我们假设url是https://service.test.com/sca/TestWebService?wsdl
以下是错误消息
无法访问以下位置的WSDL:
https://service.testwebservice.com/TestWebServiceExport?wsdl. It failed with:
Got com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is:
java.security.cert.CertPathValidatorException: The certificate issued by CN=Corp Production Root CA V1, O=Cord Inc. is not trusted; internal cause is:
java.security.cert.CertPathValidatorException: Certificate chaining error while opening stream from https://service.testwebservice.com/TestWebServiceExport?wsdl.我已经在IE浏览器上从网站安装了证书,但仍然没有成功。
发布于 2017-08-16 23:00:56
将证书安装到IE浏览器中是正确的-这将允许IE无错误地访问web服务。但是,由于您的客户端是Java (而不是IE),因此您需要将证书安装到Java中。
执行此操作的Java命令如下所示:
$JAVAHOME/bin/keytool -import -alias service.test.com -keystore $JAVA_HOME/jre/lib/security/cacerts -file ~/certfile.pem注意:这会将证书安装到该Java安装的默认密钥库中。这将影响使用该JVM的所有Java进程。密钥库的默认密码是'changeit‘
https://stackoverflow.com/questions/45716906
复制相似问题