diff --git a/packages/queue/src/Queue/Connection/Redis.php b/packages/queue/src/Queue/Connection/Redis.php index 5f15dfd13..a5726fcfb 100644 --- a/packages/queue/src/Queue/Connection/Redis.php +++ b/packages/queue/src/Queue/Connection/Redis.php @@ -202,6 +202,12 @@ protected function getRedis(): \Redis try { $redis->connect($this->host, $this->port, $connectTimeout); + if ($this->password !== null && $this->password !== '') { + // ACL form when a username is configured, plain password otherwise. + $hasUser = $this->user !== null && $this->user !== ''; + $redis->auth($hasUser ? [$this->user, $this->password] : $this->password); + } + if ($this->readTimeout >= 0) { $redis->setOption(\Redis::OPT_READ_TIMEOUT, $this->readTimeout); }