// Create an SSL context used to create an SSL socket factory
SSLContext context = SSLContext.getInstance(protocol);
// Create the key manager factory used to extract the server key
KeyManagerFactory keyManagerFactory =
KeyManagerFactory.getInstance(algorithm);
keyManagerFactory.init(keyStore, keystorePass.toCharArray());
// Create the trust manager factory used for checking certificates
/*
trustManagerFactory = TrustManagerFactory.getInstance(algorithm);
trustManagerFactory.init(keyStore);
*/
// Initialize the context with the key managers
context.init(keyManagerFactory.getKeyManagers(), null,
new java.security.SecureRandom());
// Create the proxy and return
sslProxy = context.getServerSocketFactory();