Using openssl with love

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
mmanso
Prole
Posts: 12
Joined: Tue Feb 09, 2016 12:11 pm

Using openssl with love

Post by mmanso »

Hi there

In a cross platform love game, is possible to use lua openssl module?

If yes, if there any guide about such a thing? There must be some point where any kind of compilation needs to be made for each target platform, correct?

Any docs about such a thing would be appreciated.

Thanks a lot.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Using openssl with love

Post by bobbyjones »

You just need to distribute luasec and openssl binaries for all the platforms you need to support
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Using openssl with love

Post by josefnpat »

You will need to make binaries for each platform you want to deploy to, and require them in your code. I made an effort at one point here to bring the binaries togehter here: viewtopic.php?f=5&p=158919

Honestly though, if you just need https (or a way to make a key) just use LPGhatguy's luajit request: https://github.com/LPGhatguy/luajit-request
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
mmanso
Prole
Posts: 12
Joined: Tue Feb 09, 2016 12:11 pm

Re: Using openssl with love

Post by mmanso »

Hi there

I dont need https. I need to generate some signatures to integrate some data on a foreign system.

The idea behind these concepts is to compile love2d with ssl support or compile the lua library itself with the ssl support?

Thanks a lot.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Using openssl with love

Post by bobbyjones »

It's a library. Luasec is a C library for lua that provides HTTPS. I believe it also provides other parts of openssl but I'm not sure. There is also other libraries that provide features from openssl. You can most likely google "Lua lib for x" and it will most likely pop up with a library that can do what you want. Once you find a library and it is compiled for all the platforms you want to support you will need to load it via require and from there you use the library.
mmanso
Prole
Posts: 12
Joined: Tue Feb 09, 2016 12:11 pm

Re: Using openssl with love

Post by mmanso »

Hi there,

Having the same library compiled several times (lets say lua-openssl) for different platforms how in my code will I be able to define I want to load this or that platform for lua-openssl?

Sorry for the question but I'm a newbie and since I'm loving love2d, I'm trying to kill all the requirements I have.

Thanks!
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Using openssl with love

Post by zorg »

You can get the OS with [wiki]love.system.getOS[/wiki], and if this needs to detect 32 and 64bit as separate architectures as well, then luaJIT has a neat "jit.arch" field that can tell you that too (it does have its own jit.os field as well, if you prefer that over love's, though i don't know if that will work on mobile or not)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
mmanso
Prole
Posts: 12
Joined: Tue Feb 09, 2016 12:11 pm

Re: Using openssl with love

Post by mmanso »

I'm a newbie to all this... do you have a minute to explain me the differnece between lua and luajit? Love2d uses the lua engine, correct? this is something we can choose on? have a love2d that uses lua or luajit?

Sorry for the inconvenience but like I said, I just arrived to this new and beautifull world :)

Thanks.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Using openssl with love

Post by zorg »

Löve is the engine (or rather, the framework), it is coded in the lua and C++ programming languages, and since whatever version, it handles lua through luaJIT instead of plain lua.
You still code your games in the lua language, the only difference is that on some systems (win, osx, linux), code runs faster because of the above fact.
You can not (easily) opt-out of luaJIT, but you can disable the JIT part (the just in time compiler), but that will usually not have a good effect on your game (read: it will run slower).
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Using openssl with love

Post by Nixola »

You can actually just swap the .dll/.so/whatever file with the Lua 5.1 one, if I recall correctly.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 0 guests