QUIC: add error code for handshake failed.

Jiuzhou Cui jiuzhoucui at 163.com
Thu Feb 16 13:36:52 UTC 2023


Hello!


# HG changeset patch
# User Jiuzhou Cui <cuijiuzhou at alibaba-inc.com>
# Date 1676554419 -28800
#      Thu Feb 16 21:33:39 2023 +0800
# Branch quic
# Node ID 13396c3ad10bdc8c1ac6969e965ceac510dc162f
# Parent  b87a0dbc1150f415def5bc1e1f00d02b33519026
QUIC: add error code for handshake failed.


diff -r b87a0dbc1150 -r 13396c3ad10b src/event/quic/ngx_event_quic_ssl.c
--- a/src/event/quic/ngx_event_quic_ssl.c       Tue Oct 25 12:52:09 2022 +0400
+++ b/src/event/quic/ngx_event_quic_ssl.c       Thu Feb 16 21:33:39 2023 +0800
@@ -202,7 +202,7 @@
         SSL_get0_alpn_selected(ssl_conn, &alpn_data, &alpn_len);


         if (alpn_len == 0) {
-            qc->error = 0x100 + SSL_AD_NO_APPLICATION_PROTOCOL;
+            qc->error = NGX_QUIC_ERR_CRYPTO(SSL_AD_NO_APPLICATION_PROTOCOL);
             qc->error_reason = "unsupported protocol in ALPN extension";


             ngx_log_error(NGX_LOG_INFO, c->log, 0,
@@ -452,6 +452,7 @@


         if (sslerr != SSL_ERROR_WANT_READ) {
             ngx_ssl_error(NGX_LOG_ERR, c->log, 0, "SSL_do_handshake() failed");
+            qc->error = NGX_QUIC_ERR_CRYPTO(sslerr);
             qc->error_reason = "handshake failed";
             return NGX_ERROR;
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20230216/bcf955a5/attachment.htm>


More information about the nginx-devel mailing list