Software /
code /
prosody
Comparison
plugins/mod_tls.lua @ 10784:0b0fe73199d2
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 26 Apr 2020 21:03:40 +0200 |
parent | 9975:ca01c449357f |
parent | 10783:950082c1669e |
child | 11340:a7109eb45e30 |
comparison
equal
deleted
inserted
replaced
10782:6b776f80b96e | 10784:0b0fe73199d2 |
---|---|
35 | 35 |
36 local ssl_ctx_c2s, ssl_ctx_s2sout, ssl_ctx_s2sin; | 36 local ssl_ctx_c2s, ssl_ctx_s2sout, ssl_ctx_s2sin; |
37 local ssl_cfg_c2s, ssl_cfg_s2sout, ssl_cfg_s2sin; | 37 local ssl_cfg_c2s, ssl_cfg_s2sout, ssl_cfg_s2sin; |
38 local err_c2s, err_s2sin, err_s2sout; | 38 local err_c2s, err_s2sin, err_s2sout; |
39 | 39 |
40 function module.load() | 40 function module.load(reload) |
41 local NULL = {}; | 41 local NULL = {}; |
42 local modhost = module.host; | 42 local modhost = module.host; |
43 local parent = modhost:match("%.(.*)$"); | 43 local parent = modhost:match("%.(.*)$"); |
44 | 44 |
45 local parent_ssl = rawgetopt(parent, "ssl") or NULL; | 45 local parent_ssl = rawgetopt(parent, "ssl") or NULL; |
66 if not ssl_ctx_s2sout then module:log("error", "Error creating contexts for s2sout: %s", err_s2sout); end | 66 if not ssl_ctx_s2sout then module:log("error", "Error creating contexts for s2sout: %s", err_s2sout); end |
67 | 67 |
68 -- for incoming server connections | 68 -- for incoming server connections |
69 ssl_ctx_s2sin, err_s2sin, ssl_cfg_s2sin = create_context(host.host, "server", host_s2s, host_ssl, global_s2s, request_client_certs); | 69 ssl_ctx_s2sin, err_s2sin, ssl_cfg_s2sin = create_context(host.host, "server", host_s2s, host_ssl, global_s2s, request_client_certs); |
70 if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err_s2sin); end | 70 if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err_s2sin); end |
71 | |
72 if reload then | |
73 module:log("info", "Certificates reloaded"); | |
74 else | |
75 module:log("info", "Certificates loaded"); | |
76 end | |
71 end | 77 end |
72 | 78 |
73 module:hook_global("config-reloaded", module.load); | 79 module:hook_global("config-reloaded", module.load); |
74 | 80 |
75 local function can_do_tls(session) | 81 local function can_do_tls(session) |