Menu

Fun with LuaSec and OpenSSL

Last Weekend was filled with adding a new Lua Extension addition. Started with a boring Friday evening with nothin either goin on TV or Twitch.
Before. myscite was able to do some simple http requests using luasocket. But - hey, nowdays you won't come far with that one because most dudes use SSL. Okay- one could get around by using a simple vbscript wrapper, at least thats done by myscites update checker, but like any other Nerd around - i just wanted to spend my time doing Nerd stuff that evening.
At first i learned that getting precompiled, current and working static libs for Openssl (mingw / vc / 32/64bit) can be challanging. And - fetching and compiling OpenSSL isnt really a problem. (which i thought it would be) For Mingw i just used the MSYS2- and for Windows Perl/NASM/Nmake chain.
The Pitfall was to write a nmake makefile for LuaSec - something i didnt do till now - and a rewrite of the gnu makefile so it works when called outside of MSYS2.
finally learned, that 1) invoking LD via GCC is different from invoking LD directly. - Reason: MSYS Gcc search path knows about Windows Pathes, whilst LD alone only knows MSYS internal ones. 2) The luasec build with openssl MT based libs requires ws2_32.lib and - user32.lib + advapi32.lib .
and now ? i can do in lua

status= https.request("https://www.google.com/search?q=myscite") 
print(status) 
results in : https://www.google.com/search?q=myscite [HTTP/1.1 200 OK]

For what ? i dont know. but Hey- its cool and working -hahaha.
ED: Moved 'enhanced' LuaExts to github - See here

rock on, Tho
depends: luasecs ssl.dll

Posted by Thorsten Kani 2019-04-30 Labels: LuaSec openssl
Attachments:

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.