@Override
    public void closeInbound() {
        synchronized (ssl) {
            if (state == STATE_CLOSED || state == STATE_CLOSED_INBOUND) {
                return;
            }
            if (isHandshakeStarted()) {
                if (state == STATE_CLOSED_OUTBOUND) {
                    transitionTo(STATE_CLOSED);
                } else {
                    transitionTo(STATE_CLOSED_INBOUND);
                }
                freeIfDone();
            } else {
                // Never started the handshake. Just close now.
                closeAndFreeResources();
            }
        }
    }
Returns the hostname from {@link #setHostname(String)} or supplied by the
{@link PeerInfoProvider} upon creation. No DNS resolution is attempted before
returning the hostname.
common/src/main/java/org/conscrypt/ConscryptEngine.java