throws GeneralSecurityException
{
Protocol ssafProtocol = null;
try
{
HttpSecureProtocol httpSecureProtocol = new HttpSecureProtocol();
// setup keyStore
File keystore = new File(keyStoreFilePath);
char[] keyStorePasswordInCharArray = keyStorePassword.toCharArray();
KeyMaterial keyMaterial = new KeyMaterial(keystore,
keyStorePasswordInCharArray);
// setup trustStore
File TrustMaterial = new File(trustStoreFilePath);
char[] trustStorePasswordPasswordInCharArray = trustStorePassword
.toCharArray();
TrustMaterial trustMaterial = new TrustMaterial(TrustMaterial,
trustStorePasswordPasswordInCharArray);
httpSecureProtocol.setKeyMaterial(keyMaterial);
httpSecureProtocol.setTrustMaterial(trustMaterial);
httpSecureProtocol.setCheckCRL(true);
httpSecureProtocol.setCheckExpiry(true);
httpSecureProtocol.setCheckHostname(true);
ssafProtocol = new Protocol("https",
(ProtocolSocketFactory) httpSecureProtocol, portNumber);
}
catch (GeneralSecurityException e1)