From: Marek VavruĊĦa Date: Thu, 10 Dec 2015 20:12:32 +0000 (+0100) Subject: daemon: luasec/luasocket optional X-Git-Tag: v1.0.0-beta3~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b559fe7df569712eb4af771441b3ef7cbc09f0cd;p=thirdparty%2Fknot-resolver.git daemon: luasec/luasocket optional --- diff --git a/daemon/lua/trust_anchors.lua b/daemon/lua/trust_anchors.lua index d6e91340c..6d401d061 100644 --- a/daemon/lua/trust_anchors.lua +++ b/daemon/lua/trust_anchors.lua @@ -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,