handler.clean();
System.setProperty("javax.net.ssl.keyStoreType", "pkcs11");
System.setProperty("javax.net.ssl.keyStoreProvider", providerName);
System.setProperty("javax.net.ssl.keyStore", "NONE");
if ( trustStorePath==null ) {
final Provider tlsProvider = new TLSProvider();
Security.addProvider(tlsProvider);
Security.setProperty("ssl.TrustManagerFactory.algorithm", "AcceptAll");
}
} else {
final String keyStorePath = props.getProperty("ejbcawsracli.keystore.path", "keystore.jks");
checkIfFileExists(keyStorePath);
System.setProperty("javax.net.ssl.keyStore", keyStorePath);
if (keyStorePath.endsWith(".p12")) {
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
}
if ( trustStorePath==null ) {
if (keyStorePath.endsWith(".p12")) {
final Provider tlsProvider = new TLSProvider();
Security.addProvider(tlsProvider);
Security.setProperty("ssl.TrustManagerFactory.algorithm", "AcceptAll");
} else {
System.setProperty("javax.net.ssl.trustStore", keyStorePath);
}