Skip to content

Commit 99afddd

Browse files
authored
adds support for ssl context in redis clusters (#518)
1 parent b8084d3 commit 99afddd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

includes/object-cache.php

+8
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,14 @@ protected function connect_using_phpredis( $parameters ) {
690690
$args['password'] = $parameters['password'];
691691
}
692692

693+
if ( version_compare( $version, '5.3.0', '>=' ) && defined( 'WP_REDIS_SSL_CONTEXT' ) && ! empty( WP_REDIS_SSL_CONTEXT ) ) {
694+
if ( ! array_key_exists( 'password', $args ) ) {
695+
$args['password'] = null;
696+
}
697+
698+
$args['ssl'] = WP_REDIS_SSL_CONTEXT;
699+
}
700+
693701
$this->redis = new RedisCluster( null, ...array_values( $args ) );
694702
$this->diagnostics += $args;
695703
}

0 commit comments

Comments
 (0)