code: 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;
      }
docs: Start SSL shutdown process.
  
  @return <tt>true</tt> if shutdown process is started.
  <tt>false</tt> if shutdown process is already finished.
  @throws SSLException on errors