aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-07-07 20:31:52 +0200
committerKim Alvefur <zash@zash.se>2017-07-07 20:31:52 +0200
commiteb481bfb43e58d6f6c1bd18f0761c077fa0263a4 (patch)
treef0ca0b0178bc2b732f8d8a82691a084c366c990a
parent41ea79ea5047fd3168263320362e8ee7094e0f75 (diff)
downloadprosody-eb481bfb43e58d6f6c1bd18f0761c077fa0263a4.tar.gz
prosody-eb481bfb43e58d6f6c1bd18f0761c077fa0263a4.zip
net.http: Move default SSL/TLS settings into options, allowing them to be overriden in new()
-rw-r--r--net/http.lua6
1 files 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)