Software /
code /
prosody
Comparison
plugins/mod_tls.lua @ 4244:19c9bf88ec89
mod_tls: Fix for components to more reliably inherit SSL settings from their parenthost (thanks Link Mauve)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 06 Apr 2011 14:45:44 +0100 |
parent | 4188:a395540f25e3 |
child | 4475:7341cc5c8da9 |
comparison
equal
deleted
inserted
replaced
4242:fad4a24f10bc | 4244:19c9bf88ec89 |
---|---|
89 session.secure = false; | 89 session.secure = false; |
90 return true; | 90 return true; |
91 end); | 91 end); |
92 | 92 |
93 function module.load() | 93 function module.load() |
94 local global_ssl_config = config.get("*", "core", "ssl"); | 94 local ssl_config = config.rawget(module.host, "core", "ssl"); |
95 local ssl_config = config.get(module.host, "core", "ssl"); | 95 if not ssl_config then |
96 local base_host = module.host:match("%.(.*)"); | 96 local base_host = module.host:match("%.(.*)"); |
97 if ssl_config == global_ssl_config and hosts[base_host] then | |
98 ssl_config = config.get(base_host, "core", "ssl"); | 97 ssl_config = config.get(base_host, "core", "ssl"); |
99 end | 98 end |
100 host.ssl_ctx = create_context(host.host, "client", ssl_config); -- for outgoing connections | 99 host.ssl_ctx = create_context(host.host, "client", ssl_config); -- for outgoing connections |
101 host.ssl_ctx_in = create_context(host.host, "server", ssl_config); -- for incoming connections | 100 host.ssl_ctx_in = create_context(host.host, "server", ssl_config); -- for incoming connections |
102 end | 101 end |