Diff

net/http.lua @ 12273:c0f49a4026f8

net.http: Allow using DANE via options or per request settings Dare to enable by default?
author Kim Alvefur <zash@zash.se>
date Sat, 05 Feb 2022 01:32:08 +0100
parent 11749:83d6d6a70edf
child 12881:91baddaeea84
line wrap: on
line diff
--- a/net/http.lua	Fri Feb 04 22:11:14 2022 +0100
+++ b/net/http.lua	Sat Feb 05 01:32:08 2022 +0100
@@ -287,12 +287,16 @@
 	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 });