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.