changeset 8979:3d0fc72d409e quic

HTTP/3: removed draft versions support in ALPN.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 26 Jan 2022 14:15:40 +0300
parents c37ea624c307
children d8865baab732
files src/event/quic/ngx_event_quic.c src/event/quic/ngx_event_quic.h src/http/modules/ngx_http_ssl_module.c src/http/v3/ngx_http_v3.h
diffstat 4 files changed, 0 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -1477,15 +1477,3 @@ ngx_quic_shutdown_quic(ngx_connection_t 
 }
 
 
-uint32_t
-ngx_quic_version(ngx_connection_t *c)
-{
-    uint32_t                version;
-    ngx_quic_connection_t  *qc;
-
-    qc = ngx_quic_get_connection(c);
-
-    version = qc->version;
-
-    return (version & 0xff000000) == 0xff000000 ? version & 0xff : version;
-}
--- a/src/event/quic/ngx_event_quic.h
+++ b/src/event/quic/ngx_event_quic.h
@@ -77,7 +77,6 @@ void ngx_quic_shutdown_connection(ngx_co
     const char *reason);
 ngx_int_t ngx_quic_reset_stream(ngx_connection_t *c, ngx_uint_t err);
 ngx_int_t ngx_quic_shutdown_stream(ngx_connection_t *c, int how);
-uint32_t ngx_quic_version(ngx_connection_t *c);
 ngx_int_t ngx_quic_handle_read_event(ngx_event_t *rev, ngx_uint_t flags);
 ngx_int_t ngx_quic_handle_write_event(ngx_event_t *wev, size_t lowat);
 ngx_int_t ngx_quic_get_packet_dcid(ngx_log_t *log, u_char *data, size_t len,
--- a/src/http/modules/ngx_http_ssl_module.c
+++ b/src/http/modules/ngx_http_ssl_module.c
@@ -419,9 +419,6 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t 
     unsigned char *outlen, const unsigned char *in, unsigned int inlen,
     void *arg)
 {
-#if (NGX_HTTP_V3)
-    const char              *fmt;
-#endif
     unsigned int             srvlen;
     unsigned char           *srv;
 #if (NGX_DEBUG)
@@ -466,23 +463,11 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t 
         if (h3scf->hq) {
             srv = (unsigned char *) NGX_HTTP_V3_HQ_ALPN_PROTO;
             srvlen = sizeof(NGX_HTTP_V3_HQ_ALPN_PROTO) - 1;
-            fmt = NGX_HTTP_V3_HQ_ALPN_DRAFT_FMT;
         } else
 #endif
         {
             srv = (unsigned char *) NGX_HTTP_V3_ALPN_PROTO;
             srvlen = sizeof(NGX_HTTP_V3_ALPN_PROTO) - 1;
-            fmt = NGX_HTTP_V3_ALPN_DRAFT_FMT;
-        }
-
-        /* QUIC draft */
-
-        if (ngx_quic_version(c) > 1) {
-            srv = ngx_pnalloc(c->pool, sizeof("\x05h3-xx") - 1);
-            if (srv == NULL) {
-                return SSL_TLSEXT_ERR_NOACK;
-            }
-            srvlen = ngx_sprintf(srv, fmt, ngx_quic_version(c)) - srv;
         }
 
     } else
--- a/src/http/v3/ngx_http_v3.h
+++ b/src/http/v3/ngx_http_v3.h
@@ -20,10 +20,7 @@
 
 
 #define NGX_HTTP_V3_ALPN_PROTO                     "\x02h3"
-#define NGX_HTTP_V3_ALPN_DRAFT_FMT                 "\x05h3-%02uD"
-
 #define NGX_HTTP_V3_HQ_ALPN_PROTO                  "\x0Ahq-interop"
-#define NGX_HTTP_V3_HQ_ALPN_DRAFT_FMT              "\x05hq-%02uD"
 
 #define NGX_HTTP_V3_VARLEN_INT_LEN                 4
 #define NGX_HTTP_V3_PREFIX_INT_LEN                 11