# HG changeset patch # User Kim Alvefur # Date 1410713574 -7200 # Node ID 72ef98818b9085995c62da7e5f500aec4594ec92 # Parent 4b55110b0aa8c16a85a33744a21c776266951d95 mod_s2s_auth_dane: Fix traceback caused by LuaSec not being loaded diff -r 4b55110b0aa8 -r 72ef98818b90 mod_s2s_auth_dane/mod_s2s_auth_dane.lua --- a/mod_s2s_auth_dane/mod_s2s_auth_dane.lua Sun Sep 07 12:19:25 2014 +0100 +++ b/mod_s2s_auth_dane/mod_s2s_auth_dane.lua Sun Sep 14 18:52:54 2014 +0200 @@ -47,12 +47,15 @@ local use_map = { ["DANE-EE"] = 3; ["DANE-TA"] = 2; ["PKIX-EE"] = 1; ["PKIX-CA"] = 0 } local implemented_uses = set.new { "DANE-EE", "PKIX-EE" }; -if debug.getregistry()["SSL:Certificate"].__index.issued then - -- Need cert:issued() for these - implemented_uses:add("DANE-TA"); - implemented_uses:add("PKIX-CA"); -else - module:log("warn", "Unable to support DANE-TA and PKIX-CA"); +do + local cert_mt = debug.getregistry()["SSL:Certificate"]; + if cert_mt and cert_mt.__index.issued then + -- Need cert:issued() for these + implemented_uses:add("DANE-TA"); + implemented_uses:add("PKIX-CA"); + else + module:log("warn", "Unable to support DANE-TA and PKIX-CA"); + end end local configured_uses = module:get_option_set("dane_uses", { "DANE-EE", "DANE-TA" }); local enabled_uses = set.intersection(implemented_uses, configured_uses) / function(use) return use_map[use] end;