changeset 1096:1abb8f2a5761

mod_client_certs: Update for x509 API in LuaSec 0.5
author Kim Alvefur <zash@zash.se>
date Sun, 30 Jun 2013 01:12:24 +0200
parents cb21928bca1d
children 608d9019b0de
files mod_client_certs/mod_client_certs.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_client_certs/mod_client_certs.lua	Sun Jun 30 00:50:28 2013 +0200
+++ b/mod_client_certs/mod_client_certs.lua	Sun Jun 30 01:12:24 2013 +0200
@@ -43,7 +43,7 @@
 	end
 	--]]
 
-	if not cert:valid_at(os.time()) then
+	if not cert:validat(os.time()) then
 		module:log("debug", "This certificate is not valid at this moment.");
 	end
 
@@ -144,7 +144,7 @@
 		local can_manage = append:get_child("no-cert-management", xmlns_saslcert) ~= nil;
 		x509cert = x509cert:gsub("^%s*(.-)%s*$", "%1");
 
-		local cert = x509.cert_from_pem(
+		local cert = x509.load(
 		"-----BEGIN CERTIFICATE-----\n"
 		.. x509cert ..
 		"\n-----END CERTIFICATE-----\n");
@@ -302,7 +302,7 @@
 		local name = fields.name;
 		local x509cert = fields.cert:gsub("^%s*(.-)%s*$", "%1");
 
-		local cert = x509.cert_from_pem(
+		local cert = x509.load(
 		"-----BEGIN CERTIFICATE-----\n"
 		.. x509cert ..
 		"\n-----END CERTIFICATE-----\n");
@@ -355,7 +355,7 @@
 			return
 		end
 		module:log("info", "Client Certificate: %s", cert:digest(digest_algo));
-		if not cert:valid_at(now()) then
+		if not cert:validat(now()) then
 			module:log("debug", "Client has an expired certificate", cert:digest(digest_algo));
 			return
 		end