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() == Status.BUFFER_OVERFLOW) {
      outNetBuffer.capacity(outNetBuffer.capacity() << 1);
      outNetBuffer.limit(outNetBuffer.capacity());
    }
 else {
      break;
    }
  }
  if (result.getStatus() != Status.CLOSED) {
    throw new SSLException("Improper close state: " + result);
  }
  outNetBuffer.flip();
  return true;
}

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 ( ) == Status . BUFFER_OVERFLOW ) { outNetBuffer . capacity ( outNetBuffer . capacity ( ) << 1 ) ; outNetBuffer . limit ( outNetBuffer . capacity ( ) ) ; } else { break ; } } if ( result . getStatus ( ) != Status . CLOSED ) { throw new SSLException ( "Improper close state: " + result ) ; } outNetBuffer . flip ( ) ; return true ; }
start ssl shutdown process .
