Lua API: Check whether the ssl is initialized successfully
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>main
parent
90fad37a4c
commit
34f55fa29e
|
@ -128,7 +128,16 @@ static int lua_uh_ssl_init(lua_State *L)
|
|||
const char *cert = lua_tostring(L, 2);
|
||||
const char *key = lua_tostring(L, 3);
|
||||
|
||||
lsrv->srv->ssl_init(lsrv->srv, key, cert);
|
||||
#if (!UHTTPD_SSL_SUPPORT)
|
||||
lua_pushstring(L, "SSL is not compiled in");
|
||||
lua_error(L);
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
if (lsrv->srv->ssl_init(lsrv->srv, key, cert) < 0) {
|
||||
lua_pushstring(L, "SSL init failed");
|
||||
lua_error(L);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue