Hello everyone.
I’m trying to create custom plugins using Kong.
When I execute: luarocks install kong
, luarocks tries to install every kong dependency.
Everything works except for luasec. I get the following output:
Installing https://luarocks.org/luasec-0.6-2.src.rock
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/x509.c -o src/x509.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
In file included from src/x509.h:15:0,
from src/x509.c:33:
src/config.h:19:0: warning: "luaL_newlib" redefined
#define luaL_newlib(L, R) do { lua_newtable(L); luaL_register(L, NULL, R); } while(0)
In file included from src/x509.c:31:0:
/usr/local/openresty/luajit/include/luajit-2.1/lauxlib.h:125:0: note: this is the location of the previous definition
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
src/x509.c: In function ‘push_asn1_string’:
src/x509.c:149:5: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
lua_pushlstring(L, (char*)ASN1_STRING_data(string),
^~~~~~~~~~~~~~~
In file included from /usr/include/openssl/bn.h:31:0,
from /usr/include/openssl/asn1.h:24,
from /usr/include/openssl/objects.h:916,
from /usr/include/openssl/evp.h:27,
from /usr/include/openssl/x509.h:23,
from /usr/include/openssl/ssl.h:50,
from src/x509.c:22:
/usr/include/openssl/asn1.h:553:1: note: declared here
DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
^
src/x509.c: In function ‘push_asn1_ip’:
src/x509.c:185:3: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
unsigned char *ip = ASN1_STRING_data(string);
^~~~~~~~
In file included from /usr/include/openssl/bn.h:31:0,
from /usr/include/openssl/asn1.h:24,
from /usr/include/openssl/objects.h:916,
from /usr/include/openssl/evp.h:27,
from /usr/include/openssl/x509.h:23,
from /usr/include/openssl/ssl.h:50,
from src/x509.c:22:
/usr/include/openssl/asn1.h:553:1: note: declared here
DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
^
src/x509.c: In function ‘meth_extensions’:
src/x509.c:296:35: error: dereferencing pointer to incomplete type ‘X509_EXTENSION {aka struct X509_extension_st}’
push_asn1_objname(L, extension->object, 1);
^~
src/x509.c: In function ‘meth_pubkey’:
src/x509.c:407:32: error: dereferencing pointer to incomplete type ‘EVP_PKEY {aka struct evp_pkey_st}’
switch(EVP_PKEY_type(pkey->type)) {
^~
Error: Failed installing dependency: https://luarocks.org/luasec-0.6-2.src.rock - Build error: Failed compiling object src/x509.o
Which is the EXACT error discussed in this issue: https://github.com/brunoos/luasec/issues/101
Apparently this has been fixed in luasec 0.7 and released in Jun 27.
So my questions are:
- Why do Kong specifies luasec 0.6 ? Can’t we use 0.7 ?
- How do you guys manage to install luasec 0.6 ? I can’t make it work.