Mercurial > prosody-hg
comparison plugins/mod_tls.lua @ 2636:d2805ad5b736
mod_tls: Ban TLS after auth, not before.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sun, 14 Feb 2010 10:00:39 +0500 |
| parents | e79057cf2538 |
| children | 07a6f5f9d4be |
comparison
equal
deleted
inserted
replaced
| 2635:e79057cf2538 | 2636:d2805ad5b736 |
|---|---|
| 24 | 24 |
| 25 local host = hosts[module.host]; | 25 local host = hosts[module.host]; |
| 26 | 26 |
| 27 local function can_do_tls(session) | 27 local function can_do_tls(session) |
| 28 if session.type == "c2s_unauthed" then | 28 if session.type == "c2s_unauthed" then |
| 29 return session.username and session.conn.starttls and host.ssl_ctx_in; | 29 return session.conn.starttls and host.ssl_ctx_in; |
| 30 elseif session.type == "s2sin_unauthed" then | 30 elseif session.type == "s2sin_unauthed" then |
| 31 return session.to_host and session.conn.starttls and host.ssl_ctx_in; | 31 return session.conn.starttls and host.ssl_ctx_in; |
| 32 end | 32 end |
| 33 return false; | 33 return false; |
| 34 end | 34 end |
| 35 | 35 |
| 36 -- Hook <starttls/> | 36 -- Hook <starttls/> |
