// If client authentication is needed, set up TrustManager
TrustManager[] tm = null;
if (clientAuth) {
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
tmf.init(kstore);
tm = tmf.getTrustManagers();
}
// Create a SSLContext ( to create the ssl factory )
// This is the only way to use server sockets with JSSE 1.0.1
SSLContext context = SSLContext.getInstance(protocol); // SSL