See #12. See also http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores This would allow setting keystore and truststore from the command line (with system properties).