diff -up openssl-3.0.0-alpha16/ssl/s3_msg.c.shut-down openssl-3.0.0-alpha16/ssl/s3_msg.c --- openssl-3.0.0-alpha16/ssl/s3_msg.c.shut-down 2021-05-17 11:11:11.050702699 +0200 +++ openssl-3.0.0-alpha16/ssl/s3_msg.c 2021-05-17 11:12:37.741526784 +0200 @@ -52,6 +52,8 @@ int ssl3_send_alert(SSL *s, int level, i * protocol_version alerts */ if (desc < 0) return -1; + if (s->shutdown & SSL_SENT_SHUTDOWN && desc != SSL_AD_CLOSE_NOTIFY) + return -1; /* If a fatal one, remove from cache */ if ((level == SSL3_AL_FATAL) && (s->session != NULL)) SSL_CTX_remove_session(s->session_ctx, s->session);