Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading from client: error:0A000126:SSL routines::unexpected eof while reading #276

Open
cen1 opened this issue May 30, 2024 · 0 comments
Open

Comments

@cen1
Copy link

cen1 commented May 30, 2024

Redis server logs the line from the title after each request. It is a debug log level and everything seems to work fine but I think there might still be some problem with SSL handling.

Using docker:
openresty/openresty:1.25.3.1-2-bookworm-fat
redis:7.2.5-bookworm

Redis started with:
redis-server --loglevel debug --tls-port 6379 --port 0 --tls-auth-clients no --tls-cert-file /tls/server.crt --tls-key-file /tls/server.key --tls-ca-cert-file /tls/ca.crt --requirepass 123456

LUA code:

local redis_options = {
    ssl = true,
    ssl_verify = true
}
local redis_host = os.getenv("REDIS_HOST")
local redis_port = os.getenv("REDIS_PORT")

local redis = require "resty.redis"
local red = redis:new()
local ok, err = red:connect(redis_host, redis_port, redis_options)
if not ok then
    ngx.log(ngx.ERR, "Failed to connect to Redis: ", err)
    ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end

-- Redis AUTH
local redis_password = os.getenv("REDIS_PASSWORD")
local res, err = red:auth(redis_password)
if not res then
    ngx.log("failed to authenticate with redis AUTH: ", err)
    ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end

-- do some read/writes here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant