From 4441528b1f7578397e313ce49f623bdf33003f92 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 5 Feb 2022 01:32:08 +0100 Subject: net.http: Allow using DANE via options or per request settings Dare to enable by default? --- net/http.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/http.lua b/net/http.lua index f5d03b19..332ee250 100644 --- a/net/http.lua +++ b/net/http.lua @@ -287,12 +287,16 @@ local function request(self, u, ex, callback) end local port_number = port and tonumber(port) or (using_https and 443 or 80); + local use_dane = self.options and self.options.use_dane; local sslctx = false; if using_https then sslctx = ex and ex.sslctx or self.options and self.options.sslctx; + if ex and ex.use_dane ~= nil then + use_dane = ex.use_dane; + end end - local http_service = basic_resolver.new(host, port_number, "tcp", { servername = req.host }); + local http_service = basic_resolver.new(host, port_number, "tcp", { servername = req.host; use_dane = use_dane }); connect(http_service, listener, { sslctx = sslctx }, req); self.events.fire_event("request", { http = self, request = req, url = u }); -- cgit v1.2.3