From b559fe7df569712eb4af771441b3ef7cbc09f0cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= <marek.vavrusa@nic.cz>
Date: Thu, 10 Dec 2015 21:12:32 +0100
Subject: [PATCH] daemon: luasec/luasocket optional

---
 daemon/lua/trust_anchors.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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,
-- 
GitLab