From 708ce26bc81ce86b5f0a23f4beb3119210ab6d8f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 7 Jul 2017 20:31:52 +0200 Subject: net.http: Move default SSL/TLS settings into options, allowing them to be overriden in new() --- net/http.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/http.lua b/net/http.lua index 0d14e526..756deaf4 100644 --- a/net/http.lua +++ b/net/http.lua @@ -196,7 +196,7 @@ local function request(self, u, ex, callback) local sslctx = false; if using_https then - sslctx = ex and ex.sslctx or { mode = "client", protocol = "sslv23", options = { "no_sslv2", "no_sslv3" } }; + sslctx = ex and ex.sslctx or self.options and self.options.sslctx; end local handler, conn = server.addclient(host, port_number, listener, "*a", sslctx) @@ -239,7 +239,9 @@ local function new(options) return http; end -local default_http = new(); +local default_http = new({ + sslctx = { mode = "client", protocol = "sslv23", options = { "no_sslv2", "no_sslv3" } }; +}); return { request = function (u, ex, callback) -- cgit v1.2.3