Comparison

core/s2smanager.lua @ 4329:d8b2c97ae6ed

s2smanager: Update to newer luasec
author Paul Aurich <paul@darkrain42.org>
date Mon, 06 Dec 2010 21:46:50 -0800
parent 4307:332fc256c76e
child 4421:971a66627f7a
child 4493:cad62a675b60
comparison
equal deleted inserted replaced
4328:c71777a8b9c7 4329:d8b2c97ae6ed
399 if conn.getpeercertificate then 399 if conn.getpeercertificate then
400 cert = conn:getpeercertificate() 400 cert = conn:getpeercertificate()
401 end 401 end
402 402
403 if cert then 403 if cert then
404 local chain_valid, err = conn:getpeerchainvalid() 404 local chain_valid, errors = conn:getpeerverification()
405 -- Is there any interest in printing out all/the number of errors here?
405 if not chain_valid then 406 if not chain_valid then
407 (session.log or log)("debug", "certificate chain validation result: invalid");
406 session.cert_chain_status = "invalid"; 408 session.cert_chain_status = "invalid";
407 (session.log or log)("debug", "certificate chain validation result: %s", err);
408 else 409 else
410 (session.log or log)("debug", "certificate chain validation result: valid");
409 session.cert_chain_status = "valid"; 411 session.cert_chain_status = "valid";
410 412
411 local host = session.direction == "incoming" and session.from_host or session.to_host 413 local host = session.direction == "incoming" and session.from_host or session.to_host
412 414
413 -- We'll go ahead and verify the asserted identity if the 415 -- We'll go ahead and verify the asserted identity if the