1

I'm trying to hit an API from AWS EC2 and I'm getting Exception

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException

But when I hit the same API on browser it works fine without giving any kind of warning.

API is:

https://idgenvip.qa.ch3.s.com/IDGen/services/id/generate?idType=GIFT_REGISTRY_ID

I asked one of the guy in infra, he told me it's not certificate related issue.

I have tried putting all the certs present in the server in which this API is working fine to my AWS EC2 instance, but still getting the same error.

EDIT: I've tried to ping on the idgenvip.qa.ch3.s.com and it's getting 0% packet loss.

Please help to resolve this issue.. Help of any kind would be appreciated.

Nikhil Attar
  • 105
  • 11
  • 1
    Possible duplicate of [Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Error?](https://stackoverflow.com/questions/9619030/resolving-javax-net-ssl-sslhandshakeexception-sun-security-validator-validatore) – Sambit Oct 21 '19 at 07:18
  • In the question you mentioned.. The person who's asking was getting warning when he tries to connect through browser. But in my case, It's working perfectly fine. – Nikhil Attar Oct 21 '19 at 07:44
  • For years dealing with such problems, this error: 'sun.security.validator.ValidatorException: PKIX path building failed' has always to do with a CA or leaf certificate missing into the application truststore. Note that java has its own SSL/TLS engine, so you have to list certificate inside /lib/security/cacerts and make sure it contains all the certificates required for trusting at the endpoint certificate. – vinicius.olifer Oct 21 '19 at 08:11

0 Answers0