public void testRawSSLEngine() throws Exception {
		SSLEngine server = getServerEngine();
		SSLEngine client = getClientEngine();
		
		SSLSession s = client.getSession();
		ByteBuffer unencrPacket = ByteBuffer.allocate(s.getApplicationBufferSize());
		ByteBuffer encPacket = ByteBuffer.allocate(s.getPacketBufferSize());
		
		encPacket.clear();
		unencrPacket.clear();
		doHandshakeAndVerify(client, server, unencrPacket, encPacket);
		
		doRehandshake();
		
		//connection is now established....
		encPacket.clear();
		client.closeOutbound();
		SSLEngineResult result = client.wrap(unencrPacket, encPacket);
		assertEquals(HandshakeStatus.NEED_UNWRAP, result.getHandshakeStatus());
		assertEquals(Status.CLOSED, result.getStatus());		
		
		encPacket.flip();
		result = server.unwrap(encPacket, unencrPacket);
		assertEquals(HandshakeStatus.NEED_WRAP, result.getHandshakeStatus());
		assertEquals(Status.CLOSED, result.getStatus());
		
		encPacket.clear();
		result = server.wrap(unencrPacket, encPacket);
		assertEquals(HandshakeStatus.NOT_HANDSHAKING, result.getHandshakeStatus());
		assertEquals(Status.CLOSED, result.getStatus());		

		encPacket.flip();
		result = client.unwrap(encPacket, unencrPacket);
		assertEquals(HandshakeStatus.NOT_HANDSHAKING, result.getHandshakeStatus());
		assertEquals(Status.CLOSED, result.getStatus());		
		

	}