Use Java Key Store and Trust Store

System.setProperty("javax.net.ssl.keyStore", "my.keystore");
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "JKS");
System.setProperty("javax.net.ssl.trustStore", "my.truststore");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
 
System.setProperty("javax.net.debug", "ssl,handshake");
System.setProperty( "java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol" );
Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() );
This entry was posted in java. Bookmark the permalink.