Comparison

prosodyctl @ 8201:a0ad62a269df

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 28 Aug 2017 21:05:12 +0200
parent 8181:79f73af4c410
parent 8198:db82ce3decee
child 8203:a7863f4aae65
comparison
equal deleted inserted replaced
8185:e89320b8a789 8201:a0ad62a269df
247 247
248 local modulemanager = require "core.modulemanager" 248 local modulemanager = require "core.modulemanager"
249 249
250 local prosodyctl = require "util.prosodyctl" 250 local prosodyctl = require "util.prosodyctl"
251 local socket = require "socket" 251 local socket = require "socket"
252
253 local http = require "net.http"
254 local config_ssl = config.get("*", "ssl")
255 local https_client = config.get("*", "client_https_ssl")
256 http.default.options.sslctx = require "core.certmanager".create_context("client_https port 0", "client",
257 { capath = config_ssl.capath, cafile = config_ssl.cafile, verify = "peer", }, https_client);
258
252 ----------------------- 259 -----------------------
253 260
254 -- FIXME: Duplicate code waiting for util.startup 261 -- FIXME: Duplicate code waiting for util.startup
255 function read_version() 262 function read_version()
256 -- Try to determine version 263 -- Try to determine version
1332 if what == "certs" then cert_ok = false end 1339 if what == "certs" then cert_ok = false end
1333 elseif not load_cert then 1340 elseif not load_cert then
1334 print("This version of LuaSec (" .. ssl._VERSION .. ") does not support certificate checking"); 1341 print("This version of LuaSec (" .. ssl._VERSION .. ") does not support certificate checking");
1335 cert_ok = false 1342 cert_ok = false
1336 else 1343 else
1337 for host in enabled_hosts() do 1344 local function skip_bare_jid_hosts(host)
1345 if jid_split(host) then
1346 -- See issue #779
1347 return false;
1348 end
1349 return true;
1350 end
1351 for host in it.filter(skip_bare_jid_hosts, enabled_hosts()) do
1338 print("Checking certificate for "..host); 1352 print("Checking certificate for "..host);
1339 -- First, let's find out what certificate this host uses. 1353 -- First, let's find out what certificate this host uses.
1340 local host_ssl_config = config.rawget(host, "ssl") 1354 local host_ssl_config = config.rawget(host, "ssl")
1341 or config.rawget(host:match("%.(.*)"), "ssl"); 1355 or config.rawget(host:match("%.(.*)"), "ssl");
1342 local global_ssl_config = config.rawget("*", "ssl"); 1356 local global_ssl_config = config.rawget("*", "ssl");