throws NoSuchAlgorithmException, KeyManagementException, IOException,
CertificateException, UnrecoverableKeyException, KeyStoreException
{
ServerSocketFactory serverSocketFactory = null;
SSLSocketBuilder server = new SSLSocketBuilder();
server.setUseSSLServerSocketFactory(false);
server.setSecureSocketProtocol("SSL");
server.setKeyStoreAlgorithm("SunX509");
server.setKeyStoreType("JKS");
String keyStoreFilePath = this.getClass().getResource("../.keystore").getFile();
server.setKeyStoreURL(keyStoreFilePath);
server.setKeyStorePassword("unit-tests-server");
/*
* This is optional since if not set, will use
* the key store password (and are the same in this case)
*/
//server.setKeyPassword("unit-tests-server");
serverSocketFactory = server.createSSLServerSocketFactory();
return serverSocketFactory;
}