Mercurial > prosody-hg
comparison plugins/mod_s2s.lua @ 12602:9184fe3d489a
mod_tls: Record STARTTLS state so it can be shown in Shell
This field can be viewed using s2s:show(nil, "... starttls") even
without any special support in mod_admin_shell, which can be added later
to make it nicer. One can then assume that a TLS connection with an
empty / nil starttls field means Direct TLS.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 02 Aug 2022 19:26:26 +0200 |
| parents | 65316782862f |
| children | ca4abc6ab208 |
comparison
equal
deleted
inserted
replaced
| 12601:72f7bb3f30d3 | 12602:9184fe3d489a |
|---|---|
| 427 function stream_callbacks._streamopened(session, attr) | 427 function stream_callbacks._streamopened(session, attr) |
| 428 session.version = tonumber(attr.version) or 0; | 428 session.version = tonumber(attr.version) or 0; |
| 429 session.had_stream = true; -- Had a stream opened at least once | 429 session.had_stream = true; -- Had a stream opened at least once |
| 430 | 430 |
| 431 -- TODO: Rename session.secure to session.encrypted | 431 -- TODO: Rename session.secure to session.encrypted |
| 432 if session.secure == false then | 432 if session.secure == false then -- Set by mod_tls during STARTTLS handshake |
| 433 session.starttls = "completed"; | |
| 433 session_secure(session); | 434 session_secure(session); |
| 434 end | 435 end |
| 435 | 436 |
| 436 if session.direction == "incoming" then | 437 if session.direction == "incoming" then |
| 437 -- Send a reply stream header | 438 -- Send a reply stream header |
| 748 local filter = initialize_filters(session); | 749 local filter = initialize_filters(session); |
| 749 local conn = session.conn; | 750 local conn = session.conn; |
| 750 local w = conn.write; | 751 local w = conn.write; |
| 751 | 752 |
| 752 if conn:ssl() then | 753 if conn:ssl() then |
| 754 -- Direct TLS was used | |
| 753 session_secure(session); | 755 session_secure(session); |
| 754 end | 756 end |
| 755 | 757 |
| 756 function session.sends2s(t) | 758 function session.sends2s(t) |
| 757 log("debug", "Sending[%s]: %s", session.type, t.top_tag and t:top_tag() or t:match("^[^>]*>?")); | 759 log("debug", "Sending[%s]: %s", session.type, t.top_tag and t:top_tag() or t:match("^[^>]*>?")); |
