Mercurial > prosody-hg
comparison plugins/mod_c2s.lua @ 13970:75a3ac3ad198
mod_c2s: Improve user-facing error reporting when unable to proceed
"No stream features to proceed with" isn't easy to understand for users,
with "stream features" being jargon and the whole thing being about the
technical aspect of XMPP stream negotiation.
The log messages aimed at admins are hopefully easier understood.
These cases occur when either connection security (i.e. mod_tls or
certificate settings) or authentication (mod_saslauth, auth provider) is
misconfigured or not loaded.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 01 Oct 2025 17:25:15 +0200 |
| parents | 52cf3ec248a9 |
| children | 97d15552d364 |
comparison
equal
deleted
inserted
replaced
| 13969:1b300c5a79d7 | 13970:75a3ac3ad198 |
|---|---|
| 147 limits:text_tag("idle-seconds", string.format("%d", advertised_idle_timeout)); | 147 limits:text_tag("idle-seconds", string.format("%d", advertised_idle_timeout)); |
| 148 end | 148 end |
| 149 limits:reset(); | 149 limits:reset(); |
| 150 end | 150 end |
| 151 send(features); | 151 send(features); |
| 152 elseif session.secure then | |
| 153 -- Here SASL should be offered, is mod_saslauth and mod_auth_* loaded and working correctly? | |
| 154 (session.log or log)("warn", "No stream features to offer on secure session. Check authentication settings."); | |
| 155 session:close{ condition = "undefined-condition", text = "No authentication method available" }; | |
| 152 else | 156 else |
| 153 if session.secure then | 157 -- Normally STARTTLS would be offered, is mod_tls loaded? |
| 154 -- Here SASL should be offered | 158 (session.log or log)("warn", "No stream features to offer on insecure session. Check encryption and security settings."); |
| 155 (session.log or log)("warn", "No stream features to offer on secure session. Check authentication settings."); | 159 session:close{ condition = "undefined-condition", text = "No connection encryptio available" }; |
| 156 else | |
| 157 -- Normally STARTTLS would be offered | |
| 158 (session.log or log)("warn", "No stream features to offer on insecure session. Check encryption and security settings."); | |
| 159 end | |
| 160 session:close{ condition = "undefined-condition", text = "No stream features to proceed with" }; | |
| 161 end | 160 end |
| 162 end | 161 end |
| 163 | 162 |
| 164 function stream_callbacks.streamclosed(session, attr) | 163 function stream_callbacks.streamclosed(session, attr) |
| 165 -- run _streamclosed in async context | 164 -- run _streamclosed in async context |
