0

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

We are using Java code in our application to connect to an external vendor through HTTPS. Entire Setup was working fine until last week and now we are no longer able to connect to the server from our end. Also there were no changes from our end. Client had provided us a .p12 and the same is being referred to in the code.

KeyStore clientStore = KeyStore.getInstance("PKCS12");
clientStore.load(new FileInputStream(path), Password.toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(clientStore, Password.toCharArray());
KeyManager[] kms = kmf.getKeyManagers();

I am not able to replicate the issue and below is the error while running the code locally:

java.security.KeyStoreException: The supplied keystore is not configured correctly, it must contain the 'decryptionKey' alias and the 'signingKey' alias

Above is the code snippet for your referernce. Any help or guidance would be appreciated.

Abdul Kader
  • 5,781
  • 4
  • 22
  • 40
  • Most probably the issue with the security certificate in the chain, check if it's expired. – Sergey Prokofiev May 03 '18 at 07:46
  • It's an existing interface and nothing was changed fro our end. Any clues on the cause of the issue would help – Abdul Kader May 03 '18 at 08:16
  • TRIGGER WARNING This closure may make you feel sad. If you you are liable to be distressed by this sort of thing LOOK AWAY NOW. DO NOT PASS GO. DO NOT COLLECT $200. – user207421 May 03 '18 at 08:39

0 Answers0