I want to use luasec package to construct a SSL call. I am doing this under Alpine 3.9. I have Lua 5.1, openssl-1.1.1k-r0 and openssl-dev-1.1.1k-r0. I install luasec by using "luarocks install luasec". The installation passed without error. But when I tried to use do "require ('ssl') in Lua, there's error:
> require('ssl')
error loading module 'ssl.core' from file '/usr/local/openresty/luajit/lib/lua/5.1/ssl.so':
Error relocating /usr/local/openresty/luajit/lib/lua/5.1/ssl.so: luaL_setfuncs: symbol not found
stack traceback:
[C]: ?
[C]: in function 'require'
/usr/local/openresty/luajit/share/lua/5.1/ssl.lua:8: in main chunk
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?
I expected to see the require method pass successfully but it didn't.
It turns out that I should run Luajit environment to require the LuaSec package. Previously I thought Luajit and Lua 5.1 are the same thing. I have Luajit interpreter so I should use Luajit to compile my Lua files.