HI Team,
We are using below code and its working as expected in local environment but when we deploy the same into dev and QA. its not working throwing a below error.
certificate saved under etc as p12 format.
Code:
SSLContext sslContext = SSLContexts.createSystemDefault();
Resource resource = resolver.getResource(certificatePath);
Node jcnode = resource.adaptTo(Node.class).getNode(Constant.JCR_CONTENT);
InputStream stream = jcnode.getProperty(Constant.JCR_DATA).getBinary().getStream();
KeyStore keystore = KeyStore.getInstance(Constant.JKS);
keystore.load(stream, KEYSTORESECRET.toCharArray());
sslContext = SSLContexts.custom().loadKeyMaterial(keystore, KEYSTORESECRET.toCharArray()).build();
return sslContext
Error:
createSSLContext() Invalid keystore format
Name or service not known