[PATCH 2 of 2] SSL: logging level of "invalid alert" errors

Maxim Dounin mdounin at mdounin.ru
Fri May 3 00:11:07 UTC 2024


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1714695004 -10800
#      Fri May 03 03:10:04 2024 +0300
# Node ID c8507f82ea4d0075313db01d784e5ec3caa55089
# Parent  eded0170b9606af830a23da4f26e48bf6fe5c318
SSL: logging level of "invalid alert" errors.

The SSL_R_INVALID_ALERT ("invalid alert") errors are reported by OpenSSL
1.1.1 or newer if the client sends a malformed alert.  These errors are
now logged at the "info" level.

diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -3495,6 +3495,9 @@ ngx_ssl_connection_error(ngx_connection_
 #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
             || n == SSL_R_PACKET_LENGTH_TOO_LONG                     /*  198 */
 #endif
+#ifdef SSL_R_INVALID_ALERT
+            || n == SSL_R_INVALID_ALERT                              /*  205 */
+#endif
             || n == SSL_R_RECORD_LENGTH_MISMATCH                     /*  213 */
 #ifdef SSL_R_TOO_MANY_WARNING_ALERTS
             || n == SSL_R_TOO_MANY_WARNING_ALERTS                    /*  220 */




More information about the nginx-devel mailing list