Comparison

plugins/mod_tls.lua @ 6710:d062314446f6

mod_tls: Treat session.ssl_ctx being false as a signal that TLS is disabled
author Kim Alvefur <zash@zash.se>
date Mon, 18 May 2015 21:48:58 +0200
parent 6709:b6eff3ba13de
child 6832:9566a15d3e59
comparison
equal deleted inserted replaced
6709:b6eff3ba13de 6710:d062314446f6
59 ssl_ctx_s2sin, err, ssl_cfg_s2sin = create_context(host.host, "server", host_s2s, host_ssl, global_s2s); -- for incoming server connections 59 ssl_ctx_s2sin, err, ssl_cfg_s2sin = create_context(host.host, "server", host_s2s, host_ssl, global_s2s); -- for incoming server connections
60 if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err); end 60 if not ssl_ctx_s2sin then module:log("error", "Error creating contexts for s2sin: %s", err); end
61 end 61 end
62 62
63 local function can_do_tls(session) 63 local function can_do_tls(session)
64 if not session.conn.starttls then 64 if session.ssl_ctx == false or not session.conn.starttls then
65 return false; 65 return false;
66 elseif session.ssl_ctx then 66 elseif session.ssl_ctx then
67 return true; 67 return true;
68 end 68 end
69 if session.type == "c2s_unauthed" then 69 if session.type == "c2s_unauthed" then