From 672ab9595bcadcefa5c8725fd0ba4d7d6089b4f5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 7 Jul 2017 21:04:46 +0200 Subject: net.http: Add option for disabling TLS certifictate validation --- net/http.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3