X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_http.lua;h=49529ea28b1109c264acc8cdc1ad56d487e3ea17;hb=9424020400d2fb06321ae90db14d26747342ed89;hp=afcec06959a3f2fa1fa2de83a817cde949064df4;hpb=b85f75e110d99b890fc22186cb2ad4d0c8f1d0a5;p=prosody.git diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index afcec069..49529ea2 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -1,7 +1,7 @@ -- Prosody IM -- Copyright (C) 2008-2012 Matthew Wild -- Copyright (C) 2008-2012 Waqas Hussain --- +-- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- @@ -51,6 +51,9 @@ local ports_by_scheme = { http = 80, https = 443, }; function moduleapi.http_url(module, app_name, default_path) app_name = app_name or (module.name:gsub("^http_", "")); local external_url = url_parse(module:get_option_string("http_external_url")) or {}; + if external_url.scheme and external_url.port == nil then + external_url.port = ports_by_scheme[external_url.scheme]; + end local services = portmanager.get_active_services(); local http_services = services:get("https") or services:get("http") or {}; for interface, ports in pairs(http_services) do @@ -108,7 +111,7 @@ function module.add_host(module) end end end - + local function http_app_removed(event) local app_handlers = apps[event.item.name]; apps[event.item.name] = nil; @@ -116,7 +119,7 @@ function module.add_host(module) module:unhook_object_event(server, event, handler); end end - + module:handle_items("http-provider", http_app_added, http_app_removed); server.add_host(host); @@ -139,7 +142,13 @@ module:provides("net", { listener = server.listener; default_port = 5281; encryption = "ssl"; - ssl_config = { verify = "none" }; + ssl_config = { + verify = { + peer = false, + client_once = false, + "none", + } + }; multiplex = { pattern = "^[A-Z]"; };