]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: luasec/luasocket optional
authorMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 10 Dec 2015 20:12:32 +0000 (21:12 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 10 Dec 2015 20:12:32 +0000 (21:12 +0100)
daemon/lua/trust_anchors.lua

index d6e91340c59c15efd22135161579f85e1fa7b99e..6d401d061708a7f73537b159ef979ec9d39ea972 100644 (file)
@@ -145,8 +145,11 @@ end
 
 -- Fetch over HTTPS with peert cert checked
 local function https_fetch(url, ca)
-       local https = require('ssl.https')
-       local ltn12 = require('ltn12')
+       local ssl_ok, https = pcall(require, 'ssl.https')
+       local ltn_ok, ltn12 = pcall(require, 'ltn12')
+       if not ssl_ok or not ltn_ok then
+               return nil, 'luasec and luasocket needed for root TA bootstrap'
+       end
        local resp = {}
        local r, c, h, s = https.request{
               url = url,