0

as the following logs , I write a httpclient example to invoke an API generated by AM. Then here is the error logs and which public key should I import in jre?

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
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)


Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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)
Community
  • 1
  • 1
Mike
  • 419
  • 1
  • 6
  • 16

1 Answers1

0

If you're using default keystore, you can use the cert with alias waso2carbon.

Bee
  • 12,251
  • 11
  • 46
  • 73
  • I export the public key and try to import it in jre and it prompts "Keytool Error: java.lang.Exception: The input is not an X.509 certificate" – Mike Jan 06 '17 at 08:49
  • How did you export? – Bee Jan 06 '17 at 08:58
  • change .jks file to test.pem file and copy the wso2carbon context in a test.pem and import it in jre – Mike Jan 06 '17 at 09:00
  • Read this https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html – Bee Jan 06 '17 at 09:02
  • openssl s_client -connect localhost:8243. I run the above command and generate the https certificate. It also generates the certificate .Is the certifacte right? – Mike Jan 06 '17 at 09:15