Requesting an HTTPS URL in OpenResty reports an error: Unable to get local issuer certificate
1. Request an HTTPS URL in OpenResty and report an error: Unable to get local issuer certificate. as shown in Figure 1
{
"code": 11003,
"message": "Http请求SCMS积分接口调用失败:20: unable to get local issuer certificate"
}
2. Reference URL:https://github.com/ledgetech/lua-resty-http/issues/68. client:request_uri(url, { ssl_verify = False, }).
3. Edit the request client code, add ssl_verify = False when initiated a request in lua-resty-http. as shown in Figure 2
local res, err_ = httpc:request_uri(url, {
ssl_verify = false,
method = “POST”,
body = body,
headers = {
[“Content-Type”] = “application/x-www-form-urlencoded”,
[“authorization”] = authorization,
}
})
4. Request an HTTPS URL in openresty, no errors are reported, which is in line with expectations. as shown in Figure 3


