Code example for SSLServerSocketFactory

Methods: createServerSocket

0
		SSLContext ctx = getSSLContext(serverStorePath, serverStorePassword,
				caStorePath, caStorePassword);
 
		SSLServerSocketFactory factory = ctx.getServerSocketFactory();
		SSLServerSocket serverSocket = (SSLServerSocket) factory
				.createServerSocket(port);
 
		serverSocket.setNeedClientAuth(true);
		return serverSocket;
	} 
 
	/** 
	 * 取得SSLContext 
	 *  
	 * @param keyStorePath 
	 * @param keyStorePassword 
	 * @param trustStorePath 
	 * @param trustStorePassword 
	 * @return 
	 * @throws Exception 
	 */