diff --git a/src/Launch.lua b/src/Launch.lua index 96240a4973a..5665d709541 100644 --- a/src/Launch.lua +++ b/src/Launch.lua @@ -335,7 +335,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" diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index 87dd2744cf4..ac2abc1e5b1 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -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 = { } diff --git a/src/UpdateCheck.lua b/src/UpdateCheck.lua index d3bc6ebabd6..84c2205e0ae 100644 --- a/src/UpdateCheck.lua +++ b/src/UpdateCheck.lua @@ -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") @@ -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 @@ -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()