Skip to content

Commit 6a1f08d

Browse files
committed
explicitly cast boolean SSL stream options
1 parent a79cc86 commit 6a1f08d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ public function __construct(array $options, \Redis|Relay|\RedisCluster|null $red
8888
throw new InvalidArgumentException('Cannot configure Redis Sentinel and Redis Cluster instance at the same time.');
8989
}
9090

91+
$booleanStreamOptions = [
92+
'allow_self_signed',
93+
'capture_peer_cert',
94+
'capture_peer_cert_chain',
95+
'disable_compression',
96+
'SNI_enabled',
97+
'verify_peer',
98+
'verify_peer_name',
99+
];
100+
101+
foreach ($options['ssl'] ?? [] as $streamOption => $value) {
102+
if (\in_array($streamOption, $booleanStreamOptions, true) && \is_string($value)) {
103+
$options['ssl'][$streamOption] = filter_var($value, \FILTER_VALIDATE_BOOL);
104+
}
105+
}
106+
91107
if ((\is_array($host) && null === $sentinelMaster) || $redis instanceof \RedisCluster) {
92108
$hosts = \is_string($host) ? [$host.':'.$port] : $host; // Always ensure we have an array
93109
$this->redis = static fn () => self::initializeRedisCluster($redis, $hosts, $auth, $options);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy