Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/Launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ end
function launch:DownloadPage(url, callback, params)
params = params or {}
local script = [[
local url, requestHeader, requestBody, connectionProtocol, proxyURL = ...
local url, requestHeader, requestBody, connectionProtocol, proxyURL, noSSL = ...
local responseHeader = ""
local responseBody = ""
ConPrintf("Downloading page at: %s", url)
Expand All @@ -281,6 +281,10 @@ function launch:DownloadPage(url, callback, params)
if proxyURL then
easy:setopt(curl.OPT_PROXY, proxyURL)
end
if noSSL then
easy:setopt(curl.OPT_SSL_VERIFYPEER, 0)
easy:setopt(curl.OPT_SSL_VERIFYHOST, 0)
end
easy:setopt_headerfunction(function(data)
responseHeader = responseHeader .. data
return true
Expand All @@ -303,7 +307,7 @@ function launch:DownloadPage(url, callback, params)
ConPrintf("Download complete. Status: %s", errMsg or "OK")
return responseBody, errMsg, responseHeader
]]
local id = LaunchSubScript(script, "", "ConPrintf", url, params.header, params.body, self.connectionProtocol, self.proxyURL)
local id = LaunchSubScript(script, "", "ConPrintf", url, params.header, params.body, self.connectionProtocol, self.proxyURL, self.noSSL or false)
if id then
self.subScripts[id] = {
type = "DOWNLOAD",
Expand Down Expand Up @@ -337,7 +341,7 @@ function launch:CheckForUpdate(inBackground)
self.updateProgress = "Checking..."
self.lastUpdateCheck = GetTime()
local update = io.open("UpdateCheck.lua", "r")
local id = LaunchSubScript(update:read("*a"), "GetScriptPath,GetRuntimePath,GetWorkDir,MakeDir", "ConPrintf,UpdateProgress", self.connectionProtocol, self.proxyURL)
local id = LaunchSubScript(update:read("*a"), "GetScriptPath,GetRuntimePath,GetWorkDir,MakeDir", "ConPrintf,UpdateProgress", self.connectionProtocol, self.proxyURL, self.noSSL or false)
if id then
self.subScripts[id] = {
type = "UPDATE"
Expand Down
5 changes: 5 additions & 0 deletions src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ if arg and isValueInTable(arg, "--no-jit") then
ConPrintf("JIT Disabled")
end

if arg and isValueInTable(arg, "--no-ssl") then
launch.noSSL = true
ConPrintf("SSL verification disabled")
end

local tempTable1 = { }
local tempTable2 = { }

Expand Down
12 changes: 11 additions & 1 deletion src/UpdateCheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-- Module: Update Check
-- Checks for updates
--
local connectionProtocol, proxyURL = ...
local connectionProtocol, proxyURL, noSSL = ...

local xml = require("xml")
local sha1 = require("sha1")
Expand All @@ -28,6 +28,11 @@ local function downloadFileText(source, file)
if proxyURL then
easy:setopt(curl.OPT_PROXY, proxyURL)
end
if noSSL then
easy:setopt(curl.OPT_SSL_VERIFYPEER, 0)
easy:setopt(curl.OPT_SSL_VERIFYHOST, 0)
ConPrintf("SSL verification disabled")
end
easy:setopt_writefunction(function(data)
text = text..data
return true
Expand Down Expand Up @@ -59,6 +64,11 @@ local function downloadFile(source, file, outName)
if proxyURL then
easy:setopt(curl.OPT_PROXY, proxyURL)
end
if noSSL then
easy:setopt(curl.OPT_SSL_VERIFYPEER, 0)
easy:setopt(curl.OPT_SSL_VERIFYHOST, 0)
ConPrintf("SSL verification disabled")
end
local file = io.open(outName, "wb+")
easy:setopt_writefunction(file)
local _, error = easy:perform()
Expand Down