From 37cf0024b2d222a63bc89c43ad5ef0799bfb4c00 Mon Sep 17 00:00:00 2001
From: Matthew Wild <mwild1@gmail.com>
Date: Sat, 27 Nov 2010 22:07:44 +0000
Subject: s2smanager: Check for getpeercertificate availability (for old
 LuaSecs)

---
 core/s2smanager.lua | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index be5c04fc..0990a0aa 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -376,7 +376,10 @@ end
 
 local function check_cert_status(session)
 	local conn = session.conn:socket()
-	local cert = conn:getpeercertificate()
+	local cert
+	if conn.getpeercertificate then
+		cert = conn:getpeercertificate()
+	end
 
 	if cert then
 		local chain_valid, err = conn:getpeerchainvalid()
-- 
cgit v1.2.3