By default, java does not connect to peers having self-signed certs that fail hostname/subject validation.
I have been told of one approach to this is to modify the cacerts that ship with the JVM, and another is to provide a trusted cert store to your app via
-Djavax.net.debug=SSL,trustmanager
-Djavax.net.ssl.trustStore=/path/to/trust.pkcs12
-Djavax.net.ssl.trustStorePassword=somePassword
But only one of these approaches is likely to be the best practice. Which is the best practice?