code: private static ServerSocket make_server(int port, InputStream pkcs12stream, String pkcs12Pass)
  			throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, KeyManagementException {
  		KeyStore ks = KeyStore.getInstance("PKCS12");
  		ks.load(pkcs12stream, pkcs12Pass.toCharArray());
  		KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
  		kmf.init(ks, pkcs12Pass.toCharArray());
  		SSLContext sc = SSLContext.getInstance("TLS");
  		sc.init(kmf.getKeyManagers(), null, null);
  		return sc.getServerSocketFactory().createServerSocket(port);
  	}
docs: Helper class to make a SSL socket server