luaossl 是luacrypto的代替版本,是针对 Lua 5.1、5.2、5.3 和 LuaJIT 的 OpenSSL 综合绑定。是 Lua 世界中最全面的 OpenSSL 绑定。luaosll安装依赖OpenSSL库,所以需要先安装OpenSSL。
一、安装OpenSSL
下载好的OpenSSL源码目录下,编译安装OpenSSL(以下均使用默认路径“/usr/local”进行安装)
1)生成Makefile文件
1 2
| ./config -Wl,-rpath,/usr/local/lib
|
2)安装OpenSSL
3)查看OpenSSL版本
1 2 3 4
| openssl version
OpenSSL 1.1.1q 5 Jul 2022 (Library: OpenSSL 1.1.1k FIPS 25 Mar 2021)
|
二、安装luaosll
1 2 3 4 5 6 7 8 9 10 11 12
| luarocks install luaossl
Installing https://luarocks.org/luaossl-20220711-0.src.rock
luaossl 20220711-0 depends on lua (5.1-1 provided by VM) Applying patch config.h.diff... Hunk 1 found at offset 2... gcc -O2 -fPIC -I/usr/local/include -c src/openssl.c -o src/openssl.o -D_REENTRANT -D_THREAD_SAFE -DCOMPAT53_PREFIX=luaossl -D_GNU_SOURCE -I/usr/local/include -I/usr/local/include gcc -O2 -fPIC -I/usr/local/include -c vendor/compat53/c-api/compat-5.3.c -o vendor/compat53/c-api/compat-5.3.o -D_REENTRANT -D_THREAD_SAFE -DCOMPAT53_PREFIX=luaossl -D_GNU_SOURCE -I/usr/local/include -I/usr/local/include gcc -shared -o _openssl.so src/openssl.o vendor/compat53/c-api/compat-5.3.o -L/usr/local/lib64 -L/usr/local/lib64 -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib64 -lssl -lcrypto -lpthread -lm -ldl luaossl 20220711-0 is now installed in /usr/local (license: MIT/X11)
|