我在使用客户端存根通过https发送soap请求时遇到问题。
我正在运行ubuntu 16并使用eclipse。我已使用keytool在/usr/lib/jvm/java-8-openjdk-amd64/jre/lib
中添加了证书。
任何帮助都会很高兴。
引起:sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到所请求目标的有效证书路径 at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) at sun.security.validator.Validator.validate(Validator.java:260) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491) ......还有41个 引起:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径 在sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) 在java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382) ......还有47个
答案 0 :(得分:0)
在tomcat或应用程序服务器中使用以下JVM参数,它应该可以正常工作
-Dsun.security.ssl.allowUnsafeRenegotiation=true
-Djavax.net.ssl.keyStoreType=pkcs12
-Djavax.net.ssl.keyStore=C:\client.pfx
-Djavax.net.ssl.keyStorePassword=xxxxx
-Djavax.net.ssl.keyPassword=xxxxx
-Djavax.net.ssl.trustStore=C:\keystore.jks
-Djavax.net.ssl.trustStorePassword=xxxxxx