public TLSStatus getStatus() {
        if (tlsEngineResult != null && tlsEngineResult.getStatus() == Status.BUFFER_UNDERFLOW) {
            return TLSStatus.UNDERFLOW;
        } else {
            if (tlsEngineResult != null && tlsEngineResult.getStatus() == Status.CLOSED) {
                return TLSStatus.CLOSED;
            } else {
                return switch (tlsEngine.getHandshakeStatus()) {
                    case NEED_WRAP   -> TLSStatus.NEED_WRITE;
                    case NEED_UNWRAP -> TLSStatus.NEED_READ;
                    default          -> TLSStatus.OK;
                };
            }
        }
    }
Returns the current status for this TLSHandler.

@return the current TLSStatus
xmppserver/src/main/java/org/jivesoftware/openfire/net/TLSWrapper.java