Mercurial > prosody-hg
comparison plugins/mod_tls.lua @ 6919:ab6c57633ce5
mod_tls: Fix ssl option fallback to a "parent" host if current host does not have ssl options set (thanks 70b1)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 09 Nov 2015 13:40:06 +0100 |
| parents | de35feccc78e |
| children | 0d93dfc2fbfd |
comparison
equal
deleted
inserted
replaced
| 6918:de35feccc78e | 6919:ab6c57633ce5 |
|---|---|
| 43 local parent_ssl = rawgetopt(parent, "ssl") or NULL; | 43 local parent_ssl = rawgetopt(parent, "ssl") or NULL; |
| 44 local host_ssl = rawgetopt(modhost, "ssl") or parent_ssl; | 44 local host_ssl = rawgetopt(modhost, "ssl") or parent_ssl; |
| 45 | 45 |
| 46 local global_c2s = rawgetopt("*", "c2s_ssl") or NULL; | 46 local global_c2s = rawgetopt("*", "c2s_ssl") or NULL; |
| 47 local parent_c2s = rawgetopt(parent, "c2s_ssl") or NULL; | 47 local parent_c2s = rawgetopt(parent, "c2s_ssl") or NULL; |
| 48 local host_c2s = rawgetopt(modhost, "c2s_ssl") or parent_ssl; | 48 local host_c2s = rawgetopt(modhost, "c2s_ssl") or parent_c2s; |
| 49 | 49 |
| 50 local global_s2s = rawgetopt("*", "s2s_ssl") or NULL; | 50 local global_s2s = rawgetopt("*", "s2s_ssl") or NULL; |
| 51 local parent_s2s = rawgetopt(parent, "s2s_ssl") or NULL; | 51 local parent_s2s = rawgetopt(parent, "s2s_ssl") or NULL; |
| 52 local host_s2s = rawgetopt(modhost, "s2s_ssl") or parent_ssl; | 52 local host_s2s = rawgetopt(modhost, "s2s_ssl") or parent_s2s; |
| 53 | 53 |
| 54 ssl_ctx_c2s, err, ssl_cfg_c2s = create_context(host.host, "server", host_c2s, host_ssl, global_c2s); -- for incoming client connections | 54 ssl_ctx_c2s, err, ssl_cfg_c2s = create_context(host.host, "server", host_c2s, host_ssl, global_c2s); -- for incoming client connections |
| 55 if not ssl_ctx_c2s then module:log("error", "Error creating context for c2s: %s", err); end | 55 if not ssl_ctx_c2s then module:log("error", "Error creating context for c2s: %s", err); end |
| 56 | 56 |
| 57 ssl_ctx_s2sout, err, ssl_cfg_s2sout = create_context(host.host, "client", host_s2s, host_ssl, global_s2s); -- for outgoing server connections | 57 ssl_ctx_s2sout, err, ssl_cfg_s2sout = create_context(host.host, "client", host_s2s, host_ssl, global_s2s); -- for outgoing server connections |
