FileInputStream ksf = new FileInputStream(options.keystore);
SSLContext ctx;
try
{
ctx = SSLContext.getInstance(options.protocol);
TrustManagerFactory tmf;
KeyManagerFactory kmf;
tmf = TrustManagerFactory.getInstance(options.algorithm);
KeyStore ts = KeyStore.getInstance(options.store_type);
ts.load(tsf, options.truststore_password.toCharArray());
tmf.init(ts);
kmf = KeyManagerFactory.getInstance(options.algorithm);
KeyStore ks = KeyStore.getInstance(options.store_type);
ks.load(ksf, options.keystore_password.toCharArray());
kmf.init(ks, options.keystore_password.toCharArray());
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
}
catch (Exception e)
{
throw new IOException("Error creating the initializing the SSL Context", e);