Changeset

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
parents 12272:fe0f5c47fda3
children 12274:10447f940fec
files net/http.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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 });