Changeset

8197:55826e29c719

net.http: Move default SSL/TLS settings into options, allowing them to be overriden in new()
author Kim Alvefur <zash@zash.se>
date Fri, 07 Jul 2017 20:31:52 +0200
parents 8196:bc2bcfa63b43
children 8198:db82ce3decee
files net/http.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)