diff options
author | E. Westbrook <github@westbrook.io> | 2019-02-24 16:24:42 -0700 |
---|---|---|
committer | E. Westbrook <github@westbrook.io> | 2019-02-24 16:24:42 -0700 |
commit | 2a467001f6dbadf447a79dfbd036f32b6a82ce05 (patch) | |
tree | bd2e57f3df7a04cf02a64d575e8d6f25093e3fd2 | |
parent | e587800164d5d6fb75fe34166978438c949db215 (diff) | |
download | luasocket-2a467001f6dbadf447a79dfbd036f32b6a82ce05.tar.gz luasocket-2a467001f6dbadf447a79dfbd036f32b6a82ce05.tar.bz2 luasocket-2a467001f6dbadf447a79dfbd036f32b6a82ce05.zip |
http.lua: Error informatively if insufficient LuaSec support
-rw-r--r-- | src/http.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/http.lua b/src/http.lua index 25eb25d..2fa5a26 100644 --- a/src/http.lua +++ b/src/http.lua | |||
@@ -35,7 +35,11 @@ local SCHEMES = { | |||
35 | , https = { | 35 | , https = { |
36 | port = 443 | 36 | port = 443 |
37 | , create = function(t) | 37 | , create = function(t) |
38 | return require("ssl.https").tcp(t) end }} | 38 | local https = assert( |
39 | require("ssl.https"), 'LuaSocket: LuaSec not found') | ||
40 | local tcp = assert( | ||
41 | https.tcp, 'LuaSocket: Function tcp() not available from LuaSec') | ||
42 | return tcp(t) end }} | ||
39 | 43 | ||
40 | -- default scheme and port for document retrieval | 44 | -- default scheme and port for document retrieval |
41 | local SCHEME = 'http' | 45 | local SCHEME = 'http' |