Menu

Fun with LuaSec and OpenSSL

Last Weekend was filled with adding a new Lua Extension addition. Started with a boring Friday evening whith nothin either goin on TV or Twitch.
Before. myscite was able to do som simple http requests using luasocket. But - hey, nowdays you wont 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 doin nerd stuff that evening.

and 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 LuaS ec - something i didnt to till now and rewrite 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 working -hahaha.
will upload a pack somwhere in the next days.

rock on, Tho

Posted by Thorsten Kani 2019-04-30
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.