net.http: Move default SSL/TLS settings into options, allowing them to be overriden in new()
--- a/net/http.lua Fri Jul 07 20:30:52 2017 +0200
+++ b/net/http.lua Fri Jul 07 20:31:52 2017 +0200
@@ -196,7 +196,7 @@
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 @@
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)