http.lua: Error informatively if insufficient LuaSec support

master
E. Westbrook 2019-02-24 16:24:42 -07:00
parent e587800164
commit 2a467001f6
1 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,11 @@ local SCHEMES = {
, https = {
port = 443
, create = function(t)
return require("ssl.https").tcp(t) end }}
local https = assert(
require("ssl.https"), 'LuaSocket: LuaSec not found')
local tcp = assert(
https.tcp, 'LuaSocket: Function tcp() not available from LuaSec')
return tcp(t) end }}
-- default scheme and port for document retrieval
local SCHEME = 'http'