turn off ltls by default

This commit is contained in:
Cloud Wu
2019-03-26 10:31:47 +08:00
parent eda9f771e6
commit bfbbe91efa
3 changed files with 15 additions and 6 deletions

View File

@@ -17,7 +17,13 @@ LUA_INC ?= 3rd/lua
$(LUA_STATICLIB) :
cd 3rd/lua && $(MAKE) CC='$(CC) -std=gnu99' $(PLAT)
# jemalloc
# https : turn on TLS_MODULE to add https support
# TLS_MODULE=ltls
TLS_LIB=
TLS_INC=
# jemalloc
JEMALLOC_STATICLIB := 3rd/jemalloc/lib/libjemalloc_pic.a
JEMALLOC_INC := 3rd/jemalloc/include/jemalloc
@@ -47,7 +53,7 @@ update3rd :
CSERVICE = snlua logger gate harbor
LUA_CLIB = skynet \
client \
bson md5 sproto lpeg ltls
bson md5 sproto lpeg $(TLS_MODULE)
LUA_CLIB_SKYNET = \
lua-skynet.c lua-seri.c \
@@ -107,7 +113,7 @@ $(LUA_CLIB_PATH)/sproto.so : lualib-src/sproto/sproto.c lualib-src/sproto/lsprot
$(CC) $(CFLAGS) $(SHARED) -Ilualib-src/sproto $^ -o $@
$(LUA_CLIB_PATH)/ltls.so : lualib-src/ltls.c | $(LUA_CLIB_PATH)
$(CC) $(CFLAGS) $(SHARED) -Iskynet-src -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include $^ -o $@ -lssl
$(CC) $(CFLAGS) $(SHARED) -Iskynet-src $(TLS_LIB) $(TLS_INC) $^ -o $@ -lssl
$(LUA_CLIB_PATH)/lpeg.so : 3rd/lpeg/lpcap.c 3rd/lpeg/lpcode.c 3rd/lpeg/lpprint.c 3rd/lpeg/lptree.c 3rd/lpeg/lpvm.c | $(LUA_CLIB_PATH)
$(CC) $(CFLAGS) $(SHARED) -I3rd/lpeg $^ -o $@

View File

@@ -394,7 +394,6 @@ void __attribute__((constructor)) ltls_init(void) {
void __attribute__((destructor)) ltls_destory(void) {
if(TLS_IS_INIT) {
ERR_remove_state(0);
ENGINE_cleanup();
CONF_modules_unload(1);
ERR_free_strings();

View File

@@ -29,8 +29,12 @@ end
local function main()
dns.server()
http_test("http")
print("---------")
http_test("https")
if not pcall(require,"ltls") then
print "No ltls module, https is not supported"
else
http_test("https")
end
end
skynet.start(function()