I have a java application which is hosted using WebLogic 12c managed server. It is calling an external API end point which is secured. This is an outbound connection from weblogic server to target server, for example, https://www.demosite.com/api/end/point. Initially as I got the SSLHandshake error.
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
I imported Certificate of the target server "https://www.demosite.com" into the CustomTrust.jks keystore in my weblogic managed server. Also imported the same cert into JAVA Default keystore cacerts.
With this I started seeing successful api calls. But this was not consistent. Seeing intermittent failures very often. So I decided to add below java argument to my managed server startup settings.
-Djdk.tls.client.protocols=TLSv1.2 -Dhttps.protocols=TLSv1.2
Managed server restarts are done by deleting Managed_Server tmp & cache folders. This action item did not help to fix the problem. Then made some changes to the SSL configuration in the weblogic managed server settings. Like below ones,
Hostname Verification: Custom Hostname verifier Custom Hostname Verifier: weblogic.security.utils.SSLWLSWildcardHostnameVerifier Use Server Certs: Checked Two Way Client Cert Behavior: Client Certs Requested But Not Enforced
None of the settings I tried did not help to fix the issue completely.
From Jdeveloper integrated weblogic server in my local machine the API call never fails. Only in weblogic managed server running on the Linux Server is giving this problem. In my local machine I did not import target server certs explicitly. What Am I missing here? Target allows only TLSv1.2/SSLv3 connection.