I am trying to use the curl library in a little lua script.
I know there is a "-k" option to disable the certification verification that curl does by default... but I haven't been able to find how to do it via code.
here's what I have so far:
local cURL = require("cURL")
headers = {"Accept: text/*",
"Accept-Language: en",
"Accept-Charset: iso-8859-1,*,utf-8",
"Cache-Control: no-cache"}
login_url = "https://10.10.2.1/cgi-bin/acd/myapp/controller/method?userid=tester&password=123123"
c = cURL.easy_init()
c:setopt_url(login_url)
c:perform({writefunction=function(str)
succeed = succeed or (string.find(str, "srcId:%s+SignInAlertSupressor--"))
end })
Thanks for your time.
With new version of Lua-cURL[1] you can write
local cURL = require("cURL")
headers = {
"Accept: text/*",
"Accept-Language: en",
"Accept-Charset: iso-8859-1,*,utf-8",
"Cache-Control: no-cache"
}
login_url = "https://10.10.2.1/cgi-bin/acd/myapp/controller/method?userid=tester&password=123123"
c = cURL.easy{
url = login_url,
ssl_verifypeer = false,
ssl_verifyhost = false,
httpheader = headers,
writefunction = function(str)
succeed = succeed or (string.find(str, "srcId:%s+SignInAlertSupressor--"))
end
}
c:perform()
1 - https://github.com/Lua-cURL/Lua-cURLv3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With