public boolean closeOutbound ( ) throws SSLException { if ( sslEngine == null || sslEngine . isOutboundDone ( ) ) { return false ; } sslEngine . closeOutbound ( ) ; createOutNetBuffer ( 0 ) ; SSLEngineResult result ; for ( ; ; ) { result = sslEngine . wrap ( emptyBuffer . buf ( ) , outNetBuffer . buf ( ) ) ; if ( result . getStatus ( ) == SSLEngineResult . Status . BUFFER_OVERFLOW ) { outNetBuffer . capacity ( outNetBuffer . capacity ( ) << 1 ) ; outNetBuffer . limit ( outNetBuffer . capacity ( ) ) ; } else { break ; } } if ( result . getStatus ( ) != SSLEngineResult . Status . CLOSED ) { throw new SSLException ( "Improper close state: " + result ) ; } outNetBuffer . flip ( ) ; return true ; }
Start SSL shutdown process .