Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion src/Launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function launch:DownloadPage(url, callback, params)
ConPrintf("Download complete. Status: %s", errMsg or "OK")
return responseHeader, responseBody, errMsg
]]
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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is doing what you intend. Passing this as another parameter passes it to the script variable, which is only looking for these parameters (line 255): local url, requestHeader, requestBody, connectionProtocol, proxyURL = ...

You'd want this change in launch:CheckForUpdate as well. Presumably, if SSL doesn't work on the update, it's not going to work for any other page, so we should put the option everywhere.

if id then
self.subScripts[id] = {
type = "DOWNLOAD",
Expand Down
5 changes: 5 additions & 0 deletions src/Modules/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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