Comparison

plugins/mod_tls.lua @ 12484:fb65b5a033b2

mod_tls: pass target hostname to starttls In case the network backend needs it for outgoing SNI or something.
author Jonas Schäfer <jonas@wielicki.name>
date Fri, 17 Sep 2021 21:43:54 +0200
parent 12483:988a3a7e1f35
child 12602:9184fe3d489a
comparison
equal deleted inserted replaced
12483:988a3a7e1f35 12484:fb65b5a033b2
191 191
192 module:hook_tag(xmlns_starttls, "proceed", function (session, stanza) -- luacheck: ignore 212/stanza 192 module:hook_tag(xmlns_starttls, "proceed", function (session, stanza) -- luacheck: ignore 212/stanza
193 if session.type == "s2sout_unauthed" and can_do_tls(session) then 193 if session.type == "s2sout_unauthed" and can_do_tls(session) then
194 module:log("debug", "Proceeding with TLS on s2sout..."); 194 module:log("debug", "Proceeding with TLS on s2sout...");
195 session:reset_stream(); 195 session:reset_stream();
196 session.conn:starttls(session.ssl_ctx); 196 session.conn:starttls(session.ssl_ctx, session.to_host);
197 session.secure = false; 197 session.secure = false;
198 return true; 198 return true;
199 end 199 end
200 end); 200 end);
201 201