Skip to content

Commit

Permalink
Update SocketRedisConnector.php
Browse files Browse the repository at this point in the history
Add support for TLS connection using :
(new ConnectContext())->withTlsContext($tlsContext);
  • Loading branch information
ruifil authored Oct 16, 2024
1 parent 6793505 commit 4bf7c8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Connection/SocketRedisConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ')',
Expand Down

0 comments on commit 4bf7c8e

Please sign in to comment.