private static void unwrap(SSLEngine engine, ByteBuffer packetBuf) throws SSLException {
        final ByteBuffer appBuf = ByteBuffer.allocate(engine.getSession().getApplicationBufferSize());
        // Limit the number of unwrap() calls to 8 times, to prevent a potential infinite loop.
        // 8 is an arbitrary number, it can be any number greater than 2.
        for (int i = 0; i < 8; i++) {
            appBuf.clear();
            final SSLEngineResult result = engine.unwrap(packetBuf, appBuf);
            switch (result.getHandshakeStatus()) {
                case NEED_UNWRAP:
                    continue;
                case NEED_TASK:
                    engine.getDelegatedTask().run();
                    continue;
            }
            break;
        }
    }
Makes sure the specified {@link SslContext} is configured properly. If configured as client context or
key store password is not given to key store when {@link SslContext} was created using
{@link KeyManagerFactory}, the validation will fail and an {@link IllegalStateException} will be raised.
core/src/main/java/com/linecorp/armeria/server/ServerSslContextUtil.java