]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #15387 from rgacogne/ddist-share-stek-context-identical-frontends
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 10 Apr 2025 10:13:10 +0000 (12:13 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Apr 2025 10:13:10 +0000 (12:13 +0200)
dnsdist: Share tickets key between identical frontends created via YAML

1  2 
pdns/dnsdistdist/dnsdist-configuration-yaml.cc

index 84be6b09c2a855ff922b50a9f27d34aecb277abf,9747a5de9b4e2fc24d1b3e830f851e1e6f0c1159..55ddc0eb57415054e59eed3b311388369e0c1ebf
@@@ -284,11 -285,11 +285,12 @@@ static bool handleTLSConfiguration(cons
      state.doh3Frontend = std::move(frontend);
    }
  #endif /* HAVE_DNS_OVER_HTTP3 */
 +#if defined(HAVE_DNS_OVER_HTTPS)
    else if (protocol == "doh") {
      auto frontend = std::make_shared<DOHFrontend>();
-     frontend->d_tlsContext.d_provider = std::string(bind.tls.provider);
-     boost::algorithm::to_lower(frontend->d_tlsContext.d_provider);
+     auto& tlsContext = frontend->d_tlsContext;
+     tlsContext->d_provider = std::string(bind.tls.provider);
+     boost::algorithm::to_lower(tlsContext->d_provider);
      frontend->d_library = std::string(bind.doh.provider);
      if (frontend->d_library == "h2o") {
  #ifdef HAVE_LIBH2OEVLOOP
        infolog("DNS over HTTPS configured");
      }
      else {
-       frontend->d_tlsContext.d_addr = ComboAddress(std::string(bind.listen_address), 80);
-       infolog("No certificate provided for DoH endpoint %s, running in DNS over HTTP mode instead of DNS over HTTPS", frontend->d_tlsContext.d_addr.toStringWithPort());
+       tlsContext->d_addr = ComboAddress(std::string(bind.listen_address), 80);
+       infolog("No certificate provided for DoH endpoint %s, running in DNS over HTTP mode instead of DNS over HTTPS", tlsContext->d_addr.toStringWithPort());
      }
  
-     frontend->d_tlsContext.d_proxyProtocolOutsideTLS = bind.tls.proxy_protocol_outside_tls;
-     frontend->d_tlsContext.d_tlsConfig = std::move(tlsConfig);
+     tlsContext->d_proxyProtocolOutsideTLS = bind.tls.proxy_protocol_outside_tls;
+     tlsContext->d_tlsConfig = std::move(tlsConfig);
+     tlsContext->setParent(parent);
      state.dohFrontend = std::move(frontend);
    }
 +#endif /* defined(HAVE_DNS_OVER_HTTPS) */
    else if (protocol != "do53") {
      errlog("Bind %s is configured to use an unknown protocol ('%s')", bind.listen_address, protocol);
      return false;