ledgetech / lua-resty-http

Lua HTTP client cosocket driver for OpenResty / ngx_lua.
BSD 2-Clause "Simplified" License
1.99k stars 626 forks source link

error: resty.openssl.x509.chain not found #312

Open syzh opened 7 months ago

syzh commented 7 months ago

the call require('resty.http').new() create a http client object failed。an error when checking the logs

[warn] 8#8: *109 [lua] http_connect.lua:21: failed to load moduleresty.openssl.*, mTLS isn't supported without lua-resty-openssl: /usr/local/nginx/lib/lua/resty/http_connect.lua:15: module 'resty.openssl.x509.chain' not found:

but the error did not occur in the old version

pintsized commented 7 months ago

This is not an error, just a warning to indicate that mTLS features will not work. You can adjust your Nginx log level to turn off warnings if you wish.

diarmuidie commented 6 months ago

It would be nice if there was a way to turn off/disable this warning if you aren't using the mTLS features without having to adjust the global Nginx log level. The warning gets very noisy and we don't want to increase the log level globally in Nginx because it would hide other warnings.

JustUse commented 4 months ago

is it dependenced other version openssl? it look like incompatible with lua-resty-openssl-1.3.0-1

piotrp commented 1 month ago

I have a proposal: what would you say to logging it only once, when this block of code gets hit:

        if not openssl_available then
            return nil, "module `resty.openssl.*` not available, mTLS isn't supported without lua-resty-openssl"
        end

?

I know that WARN logs can be disabled, but it's a global setting, and logging a warning that's expected to be ignored desensitizes people to legitimate warnings in logs.