[BUG]CONFIG SET tls-port crashes when TLS configuration is unavailable
Author: arshidkv12Created Sep 17, 2026Updated Sep 17, 2026
Labelsbug
Running CONFIG SET tls-port on a Valkey build where TLS configuration cannot be initialized causes the server to crash with EXC_BAD_ACCESS.
Reproduction
Start Valkey:
./src/valkey-server *:6379Then run:
./src/valkey-cli CONFIG SET tls-port 6784The server crashes with:
EXC_BAD_ACCESSThe crash occurs in:
applyTLSPortat the TLS listener lookup/dereference.
Expected behavior
CONFIG SET tls-port should return an error when TLS configuration is unavailable, without crashing the server.
For example:
ERR CONFIG SET failed (possibly related to argument 'tls-port') - Unable to update TLS configuration. Check server logs.The server should remain available:
127.0.0.1:6379> PING
PONGActual behavior
The server crashes with:
EXC_BAD_ACCESS (code=1, address=0x18)The crash occurs in:
connListener *listener = listenerByType(CONN_TYPE_TLS);
serverAssert(listener != NULL);Additional context
The issue was reproduced while debugging CONFIG SET tls-port on macOS with LLDB.
Source: valkey-io/valkey