Software / code / prosody
Comparison
plugins/mod_tls.lua @ 13803:3627980e7df6
Merge 13.0->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 01 Apr 2025 18:31:26 +0200 |
| parent | 13801:a5d5fefb8b68 |
| child | 13805:eef9a2a53dcb |
comparison
equal
deleted
inserted
replaced
| 13799:a353db59f942 | 13803:3627980e7df6 |
|---|---|
| 53 local parent_s2s = rawgetopt(parent, "s2s_ssl") or NULL; | 53 local parent_s2s = rawgetopt(parent, "s2s_ssl") or NULL; |
| 54 local host_s2s = rawgetopt(modhost, "s2s_ssl") or parent_s2s; | 54 local host_s2s = rawgetopt(modhost, "s2s_ssl") or parent_s2s; |
| 55 | 55 |
| 56 module:log("debug", "Creating context for c2s"); | 56 module:log("debug", "Creating context for c2s"); |
| 57 local request_client_certs = { verify = { "peer", "client_once", }; }; | 57 local request_client_certs = { verify = { "peer", "client_once", }; }; |
| 58 local custom_cert_verification = { verifyext = { "lsec_continue", "lsec_ignore_purpose" }; }; | |
| 58 local xmpp_alpn = { alpn = "xmpp-server" }; | 59 local xmpp_alpn = { alpn = "xmpp-server" }; |
| 59 | 60 |
| 60 ssl_ctx_c2s, err_c2s, ssl_cfg_c2s = create_context(host.host, "server", host_c2s, host_ssl, global_c2s); -- for incoming client connections | 61 ssl_ctx_c2s, err_c2s, ssl_cfg_c2s = create_context(host.host, "server", host_c2s, host_ssl, global_c2s); -- for incoming client connections |
| 61 if not ssl_ctx_c2s then module:log("error", "Error creating context for c2s: %s", err_c2s); end | 62 if not ssl_ctx_c2s then module:log("error", "Error creating context for c2s: %s", err_c2s); end |
| 62 | 63 |
| 65 ssl_ctx_s2sout, err_s2sout, ssl_cfg_s2sout = create_context(host.host, "client", host_s2s, host_ssl, global_s2s, xmpp_alpn); | 66 ssl_ctx_s2sout, err_s2sout, ssl_cfg_s2sout = create_context(host.host, "client", host_s2s, host_ssl, global_s2s, xmpp_alpn); |
| 66 if not ssl_ctx_s2sout then module:log("error", "Error creating contexts for s2sout: %s", err_s2sout); end | 67 if not ssl_ctx_s2sout then module:log("error", "Error creating contexts for s2sout: %s", err_s2sout); end |
| 67 | 68 |
| 68 module:log("debug", "Creating context for s2sin"); | 69 module:log("debug", "Creating context for s2sin"); |
| 69 -- for incoming server connections | 70 -- for incoming server connections |
| 70 ssl_ctx_s2sin, err_s2sin, ssl_cfg_s2sin = create_context(host.host, "server", host_s2s, host_ssl, global_s2s, request_client_certs); | 71 ssl_ctx_s2sin, err_s2sin, ssl_cfg_s2sin = create_context(host.host, "server", |
| 72 host_s2s, host_ssl, global_s2s, request_client_certs, custom_cert_verification | |
| 73 ); | |
| 71 if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err_s2sin); end | 74 if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err_s2sin); end |
| 72 | 75 |
| 73 if reload then | 76 if reload then |
| 74 module:log("info", "Certificates reloaded"); | 77 module:log("info", "Certificates reloaded"); |
| 75 else | 78 else |