prosody, prosodyctl: Fix traceback if ssl config is missing (thanks lookshe and sol)
authorKim Alvefur <zash@zash.se>
Tue, 29 Aug 2017 15:23:39 +0200
changeset 8205 85a60e863509
parent 8203 e92585ab4998
child 8206 a7863f4aae65
child 8207 7343ffbc65ea
prosody, prosodyctl: Fix traceback if ssl config is missing (thanks lookshe and sol)
prosody
prosodyctl
--- a/prosody	Fri Jul 07 21:04:46 2017 +0200
+++ b/prosody	Tue Aug 29 15:23:39 2017 +0200
@@ -324,7 +324,7 @@
 	end});
 
 	local http = require "net.http"
-	local config_ssl = config.get("*", "ssl")
+	local config_ssl = config.get("*", "ssl") or {}
 	local https_client = config.get("*", "client_https_ssl")
 	http.default.options.sslctx = require "core.certmanager".create_context("client_https port 0", "client",
 		{ capath = config_ssl.capath, cafile = config_ssl.cafile, verify = "peer", }, https_client);
--- a/prosodyctl	Fri Jul 07 21:04:46 2017 +0200
+++ b/prosodyctl	Tue Aug 29 15:23:39 2017 +0200
@@ -253,7 +253,7 @@
 local socket = require "socket"
 
 local http = require "net.http"
-local config_ssl = config.get("*", "ssl")
+local config_ssl = config.get("*", "ssl") or {}
 local https_client = config.get("*", "client_https_ssl")
 http.default.options.sslctx = require "core.certmanager".create_context("client_https port 0", "client",
 	{ capath = config_ssl.capath, cafile = config_ssl.cafile, verify = "peer", }, https_client);