Code example for SSLContext

Methods: createSSLEngine

0
	@Override 
	public NioChannel acceptChannel(AsynchronousServerSocketChannel listener) throws IOException {
		try { 
			AsynchronousSocketChannel asyncChannel = listener.accept().get();
			InetSocketAddress addr = (InetSocketAddress) asyncChannel.getRemoteAddress();
			SSLEngine engine = sslContext.createSSLEngine(addr.getHostString(), addr.getPort());
			NioChannel channel = new SecureNioChannel(asyncChannel, engine);
			return channel;
		} catch (Exception e) {
			throw new IOException(e);
		} 
	} 
 
	/* 
	 * (non-Javadoc) 
	 *  
	 * @see 
	 * org.apache.tomcat.util.net.NioServerSocketChannelFactory#initChannel( 
	 * org.apache.tomcat.util.net.NioChannel) 
	 */ 
	public void initChannel(NioChannel channel) throws Exception {