# HG changeset patch # User Kim Alvefur # Date 1372547544 -7200 # Node ID 1abb8f2a576173c60c5455d147c99855e70c2d5e # Parent cb21928bca1d34cfe8d350d0f4c62dd565558005 mod_client_certs: Update for x509 API in LuaSec 0.5 diff -r cb21928bca1d -r 1abb8f2a5761 mod_client_certs/mod_client_certs.lua --- 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