Mercurial > prosody-hg
comparison plugins/mod_admin_telnet.lua @ 10424:e7d3fa49495f
mod_admin_telnet: Show SNI name in show_tls() if available
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 20 Nov 2019 21:31:46 +0100 |
| parents | 496248e48a1d |
| children | e293fb8112e2 |
comparison
equal
deleted
inserted
replaced
| 10423:317bcc4f25f5 | 10424:e7d3fa49495f |
|---|---|
| 582 local info = sock:info(); | 582 local info = sock:info(); |
| 583 line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher); | 583 line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher); |
| 584 else | 584 else |
| 585 line[#line+1] = "(cipher info unavailable)"; | 585 line[#line+1] = "(cipher info unavailable)"; |
| 586 end | 586 end |
| 587 if sock.getsniname then | |
| 588 local name = sock:getsniname(); | |
| 589 if name then | |
| 590 line[#line+1] = ("(SNI:%q)"):format(name); | |
| 591 end | |
| 592 end | |
| 587 else | 593 else |
| 588 line[#line+1] = "(insecure)"; | 594 line[#line+1] = "(insecure)"; |
| 589 end | 595 end |
| 590 return table.concat(line, " "); | 596 return table.concat(line, " "); |
| 591 end | 597 end |
