From 4bf7c8ed0303f8e46877a35bf7a80231d98790a9 Mon Sep 17 00:00:00 2001 From: Rui Filipe Da Cunha Alves Date: Wed, 16 Oct 2024 14:18:20 +0200 Subject: [PATCH] Update SocketRedisConnector.php Add support for TLS connection using : (new ConnectContext())->withTlsContext($tlsContext); --- src/Connection/SocketRedisConnector.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Connection/SocketRedisConnector.php b/src/Connection/SocketRedisConnector.php index b86c96d..02898cd 100644 --- a/src/Connection/SocketRedisConnector.php +++ b/src/Connection/SocketRedisConnector.php @@ -36,6 +36,9 @@ public function connect(?Cancellation $cancellation = null): RedisConnection try { $socketConnector = $this->socketConnector ?? Socket\socketConnector(); $socket = $socketConnector->connect($this->uri, $this->connectContext, $cancellation); + if ($this->connectContext->getTlsContext()) { + $socket->setupTls($cancellation); + } } catch (Socket\SocketException $e) { throw new RedisConnectionException( 'Failed to connect to redis instance (' . $this->uri . ')',