使用 openresty (resty.http) 时出现 "handshake failed" 错误

我正在尝试在 openresty 的 lua 代码中调用一个 HTTPS 上游服务器。代码如下:

local http = require "resty.http"

local M = {}

function M.makeHttpCall()
    local httpc = http.new()
    local res, err = httpc:request_uri("https://<url>", {
        method = "GET",
        ssl_verify = false
    })
    if not res then
        ngx.status = 500
        ngx.say("错误:", err)
        return
    end

    .....
end

nginx.conf 有以下相关配置:

server {
        listen 8080;
        resolver local=on ipv6=off;
        .....
        location /httpcall {
            default_type 'application/json';
            content_by_lua_block {
                require("../lua-modules/http")["makeHttpCall"]()
            }
        }

error.log 中记录了以下错误:

SSL_do_handshake() failed (SSL: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:SSL alert number 40), client: 127.0.0.1, server: , request: "GET /httpcall HTTP/1.1", host: "localhost:8080"
http.lua:15: makeHttpCall(): **request failed: handshake failed**, client: 127.0.0.1, server: , request: "GET /httpcall HTTP/1.1", host: "localhost:8080"

HTTP 端点可以成功调用。

请指出解决问题的方法。

谢谢!

点赞