if (ep->flags.kind) {
lua_pushstring(L, ep->flags.kind);
- } else if (ep->flags.http && ep->flags.tls) {
- lua_pushliteral(L, "doh2");
+ } else if (ep->flags.http) {
+ if (ep->flags.tls) {
+ lua_pushliteral(L, "doh2");
+ } else {
+ lua_pushliteral(L, "doh2-insecure");
+ }
} else if (ep->flags.tls) {
lua_pushliteral(L, "tls");
} else if (ep->flags.xdp) {
flags.http = false;
} else if (k && strcasecmp(k, "doh2") == 0) {
flags.tls = flags.http = true;
+ } else if (k && strcasecmp(k, "doh2-insecure") == 0) {
+ flags.tls = false;
+ flags.http = true;
} else if (k) {
flags.kind = k;
if (strcasecmp(k, "doh") == 0) {
{
tcp_accept_internal(master, status, KR_PROTO_DOH);
}
+
+static void http_insecure_accept(uv_stream_t *master, int status)
+{
+ tcp_accept_internal(master, status, KR_PROTO_DOH_INSECURE);
+}
#endif
int io_listen_tcp(uv_loop_t *loop, uv_tcp_t *handle, int fd, int tcp_backlog, bool has_tls, bool has_http)
} else if (has_tls) {
connection = tls_accept;
} else if (has_http) {
- return kr_error(EPROTONOSUPPORT);
+#if ENABLE_DOH2
+ connection = http_insecure_accept;
+#else
+ kr_log_error(IO, "kresd was compiled without libnghttp2 support\n");
+ return kr_error(ENOPROTOOPT);
+#endif
} else {
connection = tcp_accept;
}
PROTOLAYER_TYPE_DNS_UNSIZED_STREAM,
};
+static const enum protolayer_type protolayer_grp_doh_insecure[] = {
+ PROTOLAYER_TYPE_TCP,
+ PROTOLAYER_TYPE_PROXYV2_STREAM,
+ PROTOLAYER_TYPE_HTTP,
+ PROTOLAYER_TYPE_DNS_UNSIZED_STREAM,
+};
+
static const enum protolayer_type protolayer_grp_doq[] = {
// not yet used
PROTOLAYER_TYPE_NULL,
XX(TCP53, tcp53, "DNS TCP") \
XX(DOT, dot, "DNS-over-TLS") \
XX(DOH, doh, "DNS-over-HTTPS") \
+ XX(DOH_INSECURE, doh_insecure, "Insecure DNS-over-HTTP") \
XX(DOQ, doq, "DNS-over-QUIC") /* unused for now */ \
//
)
from knot_resolver_manager.utils.modeling import ConfigSchema
-KindEnum = Literal["dns", "xdp", "dot", "doh-legacy", "doh2"]
+KindEnum = Literal["dns", "xdp", "dot", "doh-legacy", "doh2", "doh2-insecure"]
class EdnsBufferSizeSchema(ConfigSchema):
return PortNumber(853)
elif origin.kind in ["doh-legacy", "doh2"]:
return PortNumber(443)
+ elif origin.kind == "doh2-insecure":
+ return PortNumber(80)
return PortNumber(53)
return None