PDA

View Full Version : luasocket ssl or https?



gravy
April 3rd, 2014, 09:33 PM
Hi guys

I've been trying to retrieve a https webpage and then parse the text. I tried the socket.http methods but obviously doesn't work since I need https. It doesn't appear as though girder has the "ssl.https" library available either.

Is there any way to retrieve a webpage via https that I haven't been able to find!?

Thanks!
Scott

Tieske8
April 4th, 2014, 02:05 AM
I'm no expert on the matter, but maybe through curl? that is included, not?

gravy
April 4th, 2014, 09:21 AM
I'm no expert on the matter, but maybe through curl? that is included, not?

Thanks Tieske8 - good idea. I think i even have a working curl prototype somewhere - i'll dig it up and try it.

gravy
April 5th, 2014, 06:50 PM
Thanks Tieske8 - good idea. I think i even have a working curl prototype somewhere - i'll dig it up and try it.

Worked perfect, thanks. I used two libraries to get the website, and then parse the webpage/

for anyone searching:



local cURLextra = require('cURLextra')
local json = require('json.json')
local a,b,c,d,json_data = cURLextra.GetPost(HTTP_URL) -- json_data contains the webpage data.
local json_table = json.decode(json_data) -- decodes the json webpage into a table for easy parsing.