luasec | LuaSec depends on OpenSSL , and integrates with LuaSocket | SSH Utils library
kandi X-RAY | luasec Summary
kandi X-RAY | luasec Summary
luasec
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of luasec
luasec Key Features
luasec Examples and Code Snippets
Community Discussions
Trending Discussions on luasec
QUESTION
I am using Embarcadero C++Builder 10.1 32 bit on a Windows 7 64 bit computer. I am compiling everything with the CB10.1 32 bit free version of the Embarcadero IDE. I have compiled lua 5.3.5 to a dll. Then I compiled lua.c into a DOS executable lua.exe (using the lua dll) and it appears to run correctly. I complied luasocket 3.0rc1 to 2 dll's (socket and mime).
The luasocket scripts (ltn12.lua, mbox.lua, mime.lua, and socket.lua) are placed in the 'lua' folder. The remaining luasocket scripts ('ftp.lua', 'headers.lua', 'http.lua', 'smtp.lua', 'tp.lua' and 'url.lua') are placed in the 'socket folder. 'socket.dll' is renamed 'core.dll' and placed in the 'socket' folder. 'mime.dll' is renamed 'core.dll' and placed in the 'mime' folder.
I run lua from a DOS prompt using my compiled lua.c + dll. I can make http/ftp/smtp requests correctly. lua seems to be able to correctly find all of the luasocket core.dll and *.lua scripts.
But when I request a web page which uses https, get a module not found error when lua tries to load 'https.lua'.
So I am trying to compile and install luaSec 0.8 and OpenSSL 1.0.2s.
I want to compile luaSec to a WIN32 dll. I am able to do this. I created a new 'options.h' using 'options.lua' as required. Using a DLL dependency program (Dependency Walker 2.2), I see four exported functions from the dll:
...ANSWER
Answered 2019-Jun-15 at 02:13As @siffiejoe suggested, don't put the DLL into ssl\core.dll
, but instead make it available as ssl.dll
. The first require
call works by accident, because when you require ssl.core
, Lua maps it to ssl\core
(as one of the attempts), which maps ....\?.dll
mask in your package.cpath
variable to ....\ssl\core.dll
and then finds and calls luaopen_ssl_core
in it. This breaks for the three other calls. To resolve this, just make it available as ssl.dll.
QUESTION
I want to make a https.request with a custom user-agent using LuaSec. I've tried the method described here:
https://github.com/brunoos/luasec/wiki/LuaSec-0.4#httpsrequesturl---body
But I don't know how to pass http headers to this function with avoiding to get the response body set to the number 1, as described:
...If url is a table, the function returns the same results, except the response's body is replaced by the value 1.
ANSWER
Answered 2018-Mar-20 at 15:20If you specify a table, the first return element is always 1 on success; to receive the actual data you have to also specify a sink, to which the received data is to be stored. For example:
QUESTION
I am trying to find a way to make a secure GET request from within my nginx/lua module out to a server to check an ingress call's authentication. There seems to be very little out there on how to do this. My current attempts center around using resty.http and the following.
...ANSWER
Answered 2018-Feb-27 at 09:48Forget about luasec, your last code snippet doesn't make sense.
LuaSec is compartible with LuaSocket and definetely not compartible with nginx cosocket API.
Use generic resty-http request_uri()
interface:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install luasec
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page