Skip to content

Commit

Permalink
set the redis cluster ssl context option default to null, otherwise a…
Browse files Browse the repository at this point in the history
… TLS connection is attempted by default

Signed-off-by: robin-brabants <[email protected]>
  • Loading branch information
robin-brabants committed Mar 13, 2024
1 parent fa12b49 commit d75d373
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/RedisClusterOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ final class RedisClusterOptions extends AdapterOptions

private string $password = '';

/** @psalm-var array<string,mixed> */
private array $sslContext = [];
/** @psalm-var array<non-empty-string,mixed>|null */
private ?array $sslContext = null;

/**
* @param iterable|null|AdapterOptions $options
Expand Down Expand Up @@ -227,14 +227,17 @@ public function setPassword(string $password): void
}

/**
* @psalm-return array<string,mixed>
* @psalm-return array<non-empty-string,mixed>|null
*/
public function getSslContext(): array
public function getSslContext(): ?array
{
return $this->sslContext;
}

public function setSslContext(array $sslContext): void
/**
* @psalm-param array<non-empty-string,mixed>|null $sslContext
*/
public function setSslContext(?array $sslContext): void
{
$this->sslContext = $sslContext;
}
Expand Down
2 changes: 1 addition & 1 deletion src/RedisClusterResourceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private function createRedisResourceFromName(
float $fallbackReadTimeout,
bool $persistent,
string $fallbackPassword,
array $sslContext
?array $sslContext
): RedisClusterFromExtension {
$options = new RedisClusterOptionsFromIni();
$seeds = $options->getSeeds($name);
Expand Down

0 comments on commit d75d373

Please sign in to comment.