]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: trigger more compatibility errors for "listen quic".
authorRoman Arutyunyan <arut@nginx.com>
Thu, 26 Jan 2023 11:25:33 +0000 (15:25 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 26 Jan 2023 11:25:33 +0000 (15:25 +0400)
Now "ssl", "proxy_protocol" and "http2" are not allowed with "quic" in "listen"
directive.  Previously, only "ssl" was not allowed.

src/http/ngx_http_core_module.c

index f22d3bdab3130f2983c1c2b63979b87d03dfe0f1..3251e6da9c0c66444e9648524a9c981cf2f5aee4 100644 (file)
@@ -4320,10 +4320,26 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         return NGX_CONF_ERROR;
     }
 
-#if (NGX_HTTP_SSL && NGX_HTTP_V3)
-    if (lsopt.ssl && lsopt.quic) {
-        return "\"ssl\" parameter is incompatible with \"quic\"";
+#if (NGX_HTTP_V3)
+
+    if (lsopt.quic) {
+#if (NGX_HTTP_SSL)
+        if (lsopt.ssl) {
+            return "\"ssl\" parameter is incompatible with \"quic\"";
+        }
+#endif
+
+#if (NGX_HTTP_V2)
+        if (lsopt.http2) {
+            return "\"http2\" parameter is incompatible with \"quic\"";
+        }
+#endif
+
+        if (lsopt.proxy_protocol) {
+            return "\"proxy_protocol\" parameter is incompatible with \"quic\"";
+        }
     }
+
 #endif
 
     for (n = 0; n < u.naddrs; n++) {