code: private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause, boolean closeInbound,
                                       boolean notify, boolean alwaysFlushAndClose) {
          try {
              // Release all resources such as internal buffers that SSLEngine
              // is managing.
              outboundClosed = true;
              engine.closeOutbound();
  
              if (closeInbound) {
                  try {
                      engine.closeInbound();
                  } catch (SSLException e) {
                      if (logger.isDebugEnabled()) {
                          // only log in debug mode as it most likely harmless and latest chrome still trigger
                          // this all the time.
                          //
                          // See https://github.com/netty/netty/issues/1340
                          String msg = e.getMessage();
                          if (msg == null || !(msg.contains("possible truncation attack") ||
                                  msg.contains("closing inbound before receiving peer's close_notify"))) {
                              logger.debug("{} SSLEngine.closeInbound() raised an exception.", ctx.channel(), e);
                          }
                      }
                  }
              }
              if (handshakePromise.tryFailure(cause) || alwaysFlushAndClose) {
                  SslUtils.handleHandshakeFailure(ctx, cause, notify);
              }
          } finally {
              // Ensure we remove and fail all pending writes in all cases and so release memory quickly.
              releaseAndFailAll(cause);
          }
      }
docs: Notify all the handshake futures about the failure during the handshake.