Skip to content

Commit

Permalink
adds support for ssl context in redis clusters (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrowngold authored and tillkruss committed Oct 15, 2024
1 parent b397939 commit 872ad76
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,14 @@ protected function connect_using_phpredis( $parameters ) {
$args['password'] = $parameters['password'];
}

if ( version_compare( $version, '5.3.0', '>=' ) && defined( 'WP_REDIS_SSL_CONTEXT' ) && ! empty( WP_REDIS_SSL_CONTEXT ) ) {
if ( ! array_key_exists( 'password', $args ) ) {
$args['password'] = null;
}

$args['ssl'] = WP_REDIS_SSL_CONTEXT;
}

$this->redis = new RedisCluster( null, ...array_values( $args ) );
$this->diagnostics += $args;
}
Expand Down

0 comments on commit 872ad76

Please sign in to comment.