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;