Software /
code /
prosody
Comparison
core/s2smanager.lua @ 3663:300ae72fd692
s2smanager: Check for getpeercertificate availability (for old LuaSecs)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 27 Nov 2010 22:07:44 +0000 |
parent | 3651:337391d34b70 |
child | 3733:26571a99f6e6 |
comparison
equal
deleted
inserted
replaced
3662:dc3ccef7898f | 3663:300ae72fd692 |
---|---|
374 from=from, to=to, version='1.0', ["xml:lang"]='en'}):top_tag()); | 374 from=from, to=to, version='1.0', ["xml:lang"]='en'}):top_tag()); |
375 end | 375 end |
376 | 376 |
377 local function check_cert_status(session) | 377 local function check_cert_status(session) |
378 local conn = session.conn:socket() | 378 local conn = session.conn:socket() |
379 local cert = conn:getpeercertificate() | 379 local cert |
380 if conn.getpeercertificate then | |
381 cert = conn:getpeercertificate() | |
382 end | |
380 | 383 |
381 if cert then | 384 if cert then |
382 local chain_valid, err = conn:getpeerchainvalid() | 385 local chain_valid, err = conn:getpeerchainvalid() |
383 if not chain_valid then | 386 if not chain_valid then |
384 session.cert_chain_status = "invalid"; | 387 session.cert_chain_status = "invalid"; |