lua_State *L = (lua_State *)data;
- lua_newtable(L);
- lua_newtable(L);
+ lua_createtable(L, 0, 3);
- lua_newtable(L);
+ lua_createtable(L, entry->pins.len, 0);
for (size_t i = 0; i < entry->pins.len; ++i) {
lua_pushnumber(L, i + 1);
lua_pushstring(L, entry->pins.at[i]);
lua_settable(L, -3);
}
lua_setfield(L, -2, "pins");
- lua_newtable(L);
+
+ lua_createtable(L, entry->ca_files.len, 0);
for (size_t i = 0; i < entry->ca_files.len; ++i) {
lua_pushnumber(L, i + 1);
lua_pushstring(L, entry->ca_files.at[i]);
lua_settable(L, -3);
}
- lua_setfield(L, -2, "ca files");
- lua_newtable(L);
+ lua_setfield(L, -2, "ca_files");
+
+ lua_createtable(L, entry->hostnames.len, 0);
for (size_t i = 0; i < entry->hostnames.len; ++i) {
lua_pushnumber(L, i + 1);
lua_pushstring(L, entry->hostnames.at[i]);
lua_settable(L, -3);
}
lua_setfield(L, -2, "hostnames");
+
lua_setfield(L, -2, key);
return 0;
if (net->tls_client_params.root == 0 ) {
return 0;
}
+ lua_newtable(L);
map_walk(&net->tls_client_params, print_tls_param, (void *)L);
return 1;
}