Mercurial > prosody-hg
comparison plugins/mod_tls.lua @ 2601:e64c6a4aa50b
mod_tls: Respond with proper error when TLS cannot be negotiated.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Fri, 12 Feb 2010 02:39:50 +0500 |
| parents | 1e6f3002e04f |
| children | dff84fdebac0 |
comparison
equal
deleted
inserted
replaced
| 2600:1e6f3002e04f | 2601:e64c6a4aa50b |
|---|---|
| 25 local ssl_ctx = host and hosts[host].ssl_ctx_in or global_ssl_ctx; | 25 local ssl_ctx = host and hosts[host].ssl_ctx_in or global_ssl_ctx; |
| 26 origin.conn:starttls(ssl_ctx); | 26 origin.conn:starttls(ssl_ctx); |
| 27 origin.log("info", "TLS negotiation started for %s...", origin.type); | 27 origin.log("info", "TLS negotiation started for %s...", origin.type); |
| 28 origin.secure = false; | 28 origin.secure = false; |
| 29 else | 29 else |
| 30 -- FIXME: What reply? | |
| 31 origin.log("warn", "Attempt to start TLS, but TLS is not available on this %s connection", origin.type); | 30 origin.log("warn", "Attempt to start TLS, but TLS is not available on this %s connection", origin.type); |
| 31 (origin.sends2s or origin.send)(st.stanza("failure", { xmlns = xmlns_starttls })); | |
| 32 origin:close(); | |
| 32 end | 33 end |
| 33 return true; | 34 return true; |
| 34 end); | 35 end); |
| 35 | 36 |
| 36 | 37 |
