openresty / openresty/lua-resty-redis

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

Open
#276 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
2k
Forks
447
Avg merge
2h 24m
Merged PRs (30d)
3

Description

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...

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 with the red:connect call in the supplied Lua snippet and reproduce the setup using the listed OpenResty and Redis Docker images. Trace how resty.redis handles the ssl and ssl_verify options, then determine whether the Redis debug message is expected or indicates a client-side SSL problem; done means documenting the cause or defining a confirmed fix and regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, lua, redis
Domain
backend, databases, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.