OpenResty lua-resty-http unable to get local issuer certificate
OpenResty HTTPS 大约 451 字错误信息
在请求https
接口时,抛出了如下异常信息:
lua ssl certificate verify error: (20: unable to get local issuer certificate)
错误原因
lua-resty-http
默认是开启了证书校验,而Nginx
本地的证书与请求地址的证书不一致导致。
解决方法
lua-resty-http
中发起请求时添加ssl_verify = false
选项。
local http = require "resty.http"
local httpc = http.new()
local res, err = httpc:request_uri('https://www.test.com', {
ssl_verify = false, -- 不校验证书
keepalive_timeout = 2000 -- 毫秒
})
参考
阅读 4738 · 发布于 2021-05-10
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓
昵称:
随便看看
换一批
-
IDEA 代码折叠功能阅读 907
-
Chrome 设置 HTTP 网站允许开启麦克风阅读 812
-
Android ListView 条目点击变色阅读 3015
-
Kubernetes kubectl 命令提示阅读 778
-
Spring Boot 统一修改 Controller 返回值阅读 1619
-
java.sql.SQLDataException: ORA-01861: literal does not match format string阅读 4186
-
设计模式之装饰者模式阅读 2143
-
Android 揭露效果 Reveal Effect阅读 2461
-
Ubuntu 系统升级 MySQL 版本阅读 2495
-
Arthas 使用 tt 命令抓取调用异常、调用耗时、传入参数、返回参数阅读 4308