]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
tcpiohandler: Added a comment explaining the HTTP/1.1 addition to ALPN 13594/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Dec 2023 14:21:54 +0000 (15:21 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 12 Dec 2023 14:21:54 +0000 (15:21 +0100)
pdns/tcpiohandler.cc

index 8435913e854cb13270e53b061725ef43793c39bc..bb038e64c572560784343ed24f90521c74738e99 100644 (file)
@@ -1815,7 +1815,12 @@ bool setupDoHProtocolNegotiation(std::shared_ptr<TLSCtx>& ctx)
   if (ctx == nullptr) {
     return false;
   }
-  /* we want to set the ALPN to doh */
+  /* This code is only called for incoming/server TLS contexts (not outgoing/client),
+     and h2o sets it own ALPN values.
+     We want to set the ALPN for DoH:
+     - HTTP/1.1 so that the OpenSSL callback ALPN accepts it, letting us later return a static response
+     - HTTP/2
+  */
   const std::vector<std::vector<uint8_t>> dohAlpns{{'h', '2'},{'h', 't', 't', 'p', '/', '1', '.', '1'}};
   ctx->setALPNProtos(dohAlpns);