SSL, HTTPS in Love2D

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.
Spar
Prole
Posts: 5
Joined: Mon Jun 18, 2018 7:40 pm

Re: SSL, HTTPS in Love2D

Post by Spar »

pgimeno wrote: Tue Jun 19, 2018 11:27 pm
Spar wrote: Tue Jun 19, 2018 10:24 pm
pgimeno wrote: Tue Jun 19, 2018 8:10 pm Googling for luasec binaries gives a thread in this forum. viewtopic.php?t=76728
They're too old.
LMGTFY:

https://github.com/pkulchenko/ZeroBrane ... /bin/clibs

Code: Select all

Error: error loading module 'ssl' from file '.\ssl.dll':
        %1 is not a valid Win32 application.
-
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: SSL, HTTPS in Love2D

Post by paulclinger »

>Error: error loading module 'ssl' from file '.\ssl.dll':
> %1 is not a valid Win32 application.

This likely means that you are loading binaries from ZeroBrane Studio (which are 32bit) from a 64bit application.
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: SSL, HTTPS in Love2D

Post by paulclinger »

@Spar, I compiled luasec for x64 on Windows with openssl 1.0.2o version; it's available here (along with luasocket also compiled for x64): https://download.zerobrane.com/misc/lua ... -win64.zip

I'm also updating the build scripts for ZeroBrane Studio, so you can use them to compile the modules yourself (assuming you have mingw64 installed).
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: SSL, HTTPS in Love2D

Post by paulclinger »

One more thing; you MAY want to use my hack for ssl.lua to load the dependencies you need (otherwise you may be loading libeay32.dll and ssleay32.dll from a different location, which may be 32bit or incompatible with ssl.dll): https://github.com/pkulchenko/ZeroBrane ... lua#L7-L15
Particle_G
Prole
Posts: 1
Joined: Sat Oct 16, 2021 3:39 am

Re: SSL, HTTPS in Love2D

Post by Particle_G »

Made a cross platform luasec lib for love2d. Compiled by love's luajit source code.
https://github.com/26F-Studio/love-luasec
This is a CMake project, should be easy to use.

also with demo:

local http = require"socket.http"
local https = require"https"
print(http.request("http://www.bilibili.com"))
print(https.request("https://www.bilibili.com"))

if there's no ssl, the second request would return a 301
Last edited by Particle_G on Sat Oct 16, 2021 4:06 am, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 16 guests