diff options
author | Kim Alvefur <zash@zash.se> | 2022-02-05 01:32:08 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-02-05 01:32:08 +0100 |
commit | 4441528b1f7578397e313ce49f623bdf33003f92 (patch) | |
tree | c40c1d936c4aeabb6e8304b539ad05dacd58aebf | |
parent | a3a343b20ebf388581f61e207c424f96d785c5e5 (diff) | |
download | prosody-4441528b1f7578397e313ce49f623bdf33003f92.tar.gz prosody-4441528b1f7578397e313ce49f623bdf33003f92.zip |
net.http: Allow using DANE via options or per request settings
Dare to enable by default?
-rw-r--r-- | net/http.lua | 6 |
1 files changed, 5 insertions, 1 deletions
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 }); |