I need to set trustStore and trustStorePassword with in the EAR or WAR by using System.setProperty() method, on the same lines I printed System.getProperties() and found in logs that javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword were being set to the exact location and password what it needs to be set, but still not able to validate server certificate from the trustStore.
Getting this error :
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
But if I set these two parameters from the startup script i.e.
$JBOSS_HOME/bin/standalone.sh -c standalone-full-ha.xml -Djavax.net.debug=none -Djavax.net.ssl.trustStore=path to truststore.jks -Djavax.net.ssl.trustStorePassword=password
It was able to validate server's certificate successfully.
Is there any restrictions in the JBOSS EAP 7.1 to set System Properties from the deployments ? or Is there any configuration that I was missing ?