]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
DoH: reject non-h2 early 980/head
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>
Thu, 14 Dec 2023 00:58:44 +0000 (16:58 -0800)
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>
Thu, 14 Dec 2023 00:58:44 +0000 (16:58 -0800)
Previously, non-h2 connections would be accepted, and then error out
with a verbose message "http2: session_recv from ____ failed,
error: Received bad client magic byte string". Instead, we can detect
absence of h2 support at connection time and reject with a clearer
verbose message.

util/netevent.c

index 141e48d48b3f66aa88a370a6925f9f42095b19d0..d517ae544ed1d558312c487abb852240d804bde9 100644 (file)
@@ -1748,6 +1748,9 @@ ssl_handshake(struct comm_point* c)
                        /* connection upgraded to HTTP2 */
                        c->tcp_do_toggle_rw = 0;
                        c->use_h2 = 1;
+               } else {
+                       verbose(VERB_ALGO, "client doesn't support HTTP/2");
+                       return 0;
                }
        }
 #endif