ledgetech / ledgetech/lua-resty-http

tengine2.3.4+tongsuo 8.4+lua-nginx-module+LuaJIT 2.1.1710398010

Open
#315 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
2.1k
Forks
630
PR merge metrics
No merged PRs in 30d

Description

luajit -v
LuaJIT 2.1.1710398010 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/

nignx -V
configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --with-http_lua_module --with-threads --with-file-aio --with-select_module --with-poll_module --with-http_ssl_module --with-http_stub_status_module --with-http_degradation_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-stream_sni --with-stream_ssl_preread_module --with-openssl=/opt/compile/depend/Tongsuo--with-openssl-opt='--api=1.1.1 enable-ntls' --add-module=modules/ngx_openssl_ntls --add-module=/opt/compile/depend/headers-more-nginx-module-0.33

nginx.conf

lua_package_path '/opt/luarocks/share/lua/5.1/?.lua;;';
lua_package_cpath '/opt/luarocks/lib/lua/5.1/?.so;;';

location ^~ /lua {
content_by_lua_block {
local json = require("cjson")
local http = require("resty.http")

local uri = "https://www.baidu.com"

ngx.log(ngx.ERR, "request url: " .. uri)
ngx.say("request to ", uri)

local httpc = http.new()
local res, err = httpc:request_uri(uri, {
method = "GET",
})

if not res then
ngx.say("Failed to post request to ", uri, ": ", err)
return
end

ngx.say("Status: ", res.status)
ngx.say("Body: ", res.body)

            }

}

error.log

2024/05/10 18:12:29 [info] 4698#4698: *39 SSL_do_handshake() failed (SSL: error:0A000416:SSL routines::sslv3 alert certificate unknown:SSL alert number 46) while SSL handshaking, client: 10.11.47.29, server: 0.0.0.0:443
2024/05/10 18:12:29 [info] 4698#4698: *40 SSL_do_handshake() failed (SSL: error:0A000416:SSL routines::sslv3 alert certificate unknown:SSL alert number 46) while SSL handshaking, client: 10.11.47.29, server: 0.0.0.0:443
2024/05/10 18:12:29 [warn] 4698#4698: *41 [lua] http_connect.lua:21: failed to load module resty.openssl.*, mTLS isn't supported without lua-resty-openssl:
/opt/luarocks/share/lua/5.1/resty/http_connect.lua:15: module 'resty.openssl.x509.chain' not found:
no field package.preload['resty.openssl.x509.chain']
no file '/opt/luarocks/share/lua/5.1/resty/openssl/x509/chain.lua'
no file './resty/openssl/x509/chain.lua'
no file '/usr/local/share/luajit-2.1/resty/openssl/x509/chain.lua'
no file '/usr/local/share/lua/5.1/resty/openssl/x509/chain.lua'
no file '/usr/local/share/lua/5.1/resty/openssl/x509/chain/init.lua'
no file '/opt/luarocks/lib/lua/5.1/resty/openssl/x509/chain.so'
no file './resty/openssl/x509/chain.so'
no file '/usr/local/lib/lua/5.1/resty/openssl/x509/chain.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/opt/luarocks/lib/lua/5.1/resty.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
/opt/luarocks/share/lua/5.1/resty/http_connect.lua:15: in function </opt/luarocks/share/lua/5.1/resty/http_connect.lua:14>
[C]: in function 'xpcall'
/opt/luarocks/share/lua/5.1/resty/http_connect.lua:14: in main chunk
[C]: in function 'require'
/opt/luarocks/share/lua/5.1/resty/http.lua:166: in main chunk
[C]: in function 'require'
content_by_lua(login.conf:76):5: in main chunk, client: 10.11.47.29, server: , request: "GET /lua HTTP/1.1", host: "10.50.89.231"
2024/05/10 18:12:29 [error] 4698#4698: *41 [lua] content_by_lua(login.conf:76):13: request url: https://www.baidu.com, client: 10.11.47.29, server: , request: "GET /lua HTTP/1.1", host: "10.50.89.231"
2024/05/10 18:12:29 [debug] 4698#4698: *41 [lua] http_connect.lua:253: connect(): poolname: https:www.baidu.com:443:true:www.baidu.com:false:::
2024/05/10 18:12:29 [notice] 13827#13827: signal 17 (SIGCHLD) received from 4698
2024/05/10 18:12:29 [alert] 13827#13827: worker process 4698 exited on signal 11

Does the lua-resty-http library have compatibility issues with the TongSuo SSL library?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported crash with the listed Tengine, TongSuo, LuaJIT, and lua-resty-http configuration. Inspect lua-resty-http's http_connect.lua and http.lua around the resty.openssl require and request_uri path, using the nginx.conf and error.log details as the test case. Done should establish whether the failure is library compatibility, a missing dependency, or an external configuration issue, with the conclusion and any required fix documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.