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 -- 毫秒
})
参考
阅读 3594 · 发布于 2021-05-10
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Kubernetes 使用 Telepresence 转发内部流量到本地开发环境阅读 1593
-
网页添加 GitHub star, fork, fllow, watch 按钮阅读 2626
-
IDEA 远程调试 Docker 容器中的 Spring Boot 程序阅读 1531
-
MySQL 查询过程阅读 2372
-
Docker 同步宿主机时区阅读 342
-
OpenResty 整合 LuaRocks - Linux阅读 2369
-
Android 双击退出应用程序阅读 3146
-
Spring Boot 配置异步任务、定时任务、Tomcat 的线程池参数阅读 677
-
Angular error TS2564: Property 'xx' has no initializer and is not definitely assigned in the constructor.阅读 692
-
Android ContentProvider 提供 Assets 目录下的图片或文件阅读 2078