lua - verify certs when doing HTTPS requests

This commit is contained in:
florian
2021-10-23 10:10:24 +02:00
parent 163af4a49d
commit c00c7f46a0
3 changed files with 3316 additions and 1 deletions

3314
lua/misc/root-ca.pem Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,6 @@ end
function M.check (token, recaptcha_secret)
local httpc = http.new()
local res, err = httpc:request_uri("https://www.google.com/recaptcha/api/siteverify", {
ssl_verify = false,
method = "POST",
body = "secret=" .. recaptcha_secret .. "&response=" .. token .. "&remoteip=" .. ngx.var.remote_addr,
headers = { ["Content-Type"] = "application/x-www-form-urlencoded" }