Skip to content

Commit 9ac5ceb

Browse files
authored
Added SSL bypass to launch:DownloadPage function (#9099)
1 parent dbcf0c9 commit 9ac5ceb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Launch.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ end
254254
function launch:DownloadPage(url, callback, params)
255255
params = params or {}
256256
local script = [[
257-
local url, requestHeader, requestBody, connectionProtocol, proxyURL = ...
257+
local url, requestHeader, requestBody, connectionProtocol, proxyURL, noSSL = ...
258258
local responseHeader = ""
259259
local responseBody = ""
260260
ConPrintf("Downloading page at: %s", url)
@@ -281,6 +281,10 @@ function launch:DownloadPage(url, callback, params)
281281
if proxyURL then
282282
easy:setopt(curl.OPT_PROXY, proxyURL)
283283
end
284+
if noSSL then
285+
easy:setopt(curl.OPT_SSL_VERIFYPEER, 0)
286+
easy:setopt(curl.OPT_SSL_VERIFYHOST, 0)
287+
end
284288
easy:setopt_headerfunction(function(data)
285289
responseHeader = responseHeader .. data
286290
return true
@@ -303,7 +307,7 @@ function launch:DownloadPage(url, callback, params)
303307
ConPrintf("Download complete. Status: %s", errMsg or "OK")
304308
return responseBody, errMsg, responseHeader
305309
]]
306-
local id = LaunchSubScript(script, "", "ConPrintf", url, params.header, params.body, self.connectionProtocol, self.proxyURL)
310+
local id = LaunchSubScript(script, "", "ConPrintf", url, params.header, params.body, self.connectionProtocol, self.proxyURL, self.noSSL or false)
307311
if id then
308312
self.subScripts[id] = {
309313
type = "DOWNLOAD",

0 commit comments

Comments
 (0)