aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-07-07 21:04:46 +0200
committerKim Alvefur <zash@zash.se>2017-07-07 21:04:46 +0200
commit7e28119b3d3fe91b2f8541da2af90b232ab38412 (patch)
treef9ddd6059ceb8075d03c78e319434331bb25159b /net
parente605ac0987662ef14c3f0b642079a815961102e1 (diff)
downloadprosody-7e28119b3d3fe91b2f8541da2af90b232ab38412.tar.gz
prosody-7e28119b3d3fe91b2f8541da2af90b232ab38412.zip
net.http: Add option for disabling TLS certifictate validation
Diffstat (limited to 'net')
-rw-r--r--net/http.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/http.lua b/net/http.lua
index eba050cd..8364a104 100644
--- a/net/http.lua
+++ b/net/http.lua
@@ -37,7 +37,7 @@ function listener.onconnect(conn)
local req = requests[conn];
-- Validate certificate
- if conn:ssl() then
+ if not req.insecure and conn:ssl() then
local sock = conn:socket();
local chain_valid = sock.getpeerverification and sock:getpeerverification();
if not chain_valid then
@@ -202,6 +202,7 @@ local function request(self, u, ex, callback)
headers[k] = v;
end
end
+ req.insecure = ex.insecure;
end
log("debug", "Making %s %s request '%s' to %s", req.scheme:upper(), method or "GET", req.id, (ex and ex.suppress_url and host_header) or u);