Software / code / prosody
Comparison
plugins/mod_c2s.lua @ 5859:e327f2d4e09f
mod_c2s, mod_s2s: Set session.encrypted as session.secure does not allways mean encrypted (eg consider_bosh_secure)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 07 Oct 2013 12:43:00 +0200 |
| parent | 5802:5b79710dd5a1 |
| child | 6005:98b768a41c9d |
comparison
equal
deleted
inserted
replaced
| 5857:8613888d0f9e | 5859:e327f2d4e09f |
|---|---|
| 67 | 67 |
| 68 -- If session.secure is *false* (not nil) then it means we /were/ encrypting | 68 -- If session.secure is *false* (not nil) then it means we /were/ encrypting |
| 69 -- since we now have a new stream header, session is secured | 69 -- since we now have a new stream header, session is secured |
| 70 if session.secure == false then | 70 if session.secure == false then |
| 71 session.secure = true; | 71 session.secure = true; |
| 72 session.encrypted = true; | |
| 72 | 73 |
| 73 local sock = session.conn:socket(); | 74 local sock = session.conn:socket(); |
| 74 if sock.info then | 75 if sock.info then |
| 75 local info = sock:info(); | 76 local info = sock:info(); |
| 76 (session.log or log)("info", "Stream encrypted (%s with %s)", info.protocol, info.cipher); | 77 (session.log or log)("info", "Stream encrypted (%s with %s)", info.protocol, info.cipher); |
| 207 session.log("info", "Client connected"); | 208 session.log("info", "Client connected"); |
| 208 | 209 |
| 209 -- Client is using legacy SSL (otherwise mod_tls sets this flag) | 210 -- Client is using legacy SSL (otherwise mod_tls sets this flag) |
| 210 if conn:ssl() then | 211 if conn:ssl() then |
| 211 session.secure = true; | 212 session.secure = true; |
| 213 session.encrypted = true; | |
| 212 | 214 |
| 213 -- Check if TLS compression is used | 215 -- Check if TLS compression is used |
| 214 local sock = conn:socket(); | 216 local sock = conn:socket(); |
| 215 if sock.info then | 217 if sock.info then |
| 216 session.compressed = sock:info"compression"; | 218 session.compressed = sock:info"compression"; |