#4727·valkey

[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:

bash
./src/valkey-server *:6379

Then run:

bash
./src/valkey-cli CONFIG SET tls-port 6784

The server crashes with:

EXC_BAD_ACCESS

The crash occurs in:

applyTLSPort

at 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
PONG

Actual behavior

The server crashes with:

EXC_BAD_ACCESS (code=1, address=0x18)

The crash occurs in:

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