private static LettucePoolingClientConfiguration getRedisPoolClientConfig(final BaseRedisProperties redis,
                                                                              final CasSSLContext casSslContext) throws Exception {
        var poolingClientConfig = LettucePoolingClientConfiguration.builder();
        if (redis.isUseSsl()) {
            val sslPoolingConfig = poolingClientConfig.useSsl();
            FunctionUtils.doWhen(!redis.isVerifyPeer(), __ -> sslPoolingConfig.disablePeerVerification());
            FunctionUtils.doWhen(redis.isStartTls(), __ -> sslPoolingConfig.startTls());
            LOGGER.trace("Redis configuration: SSL connections are enabled");
        }
        if (redis.getReadFrom() != null) {
            poolingClientConfig.readFrom(ReadFrom.valueOf(redis.getReadFrom().name()));
            LOGGER.debug("Redis configuration: readFrom property is set to [{}]", redis.getReadFrom());
        }

        if (StringUtils.hasText(redis.getTimeout())) {
            val commandTimeout = Beans.newDuration(redis.getTimeout());
            val commandTimeoutMillis = commandTimeout.toMillis();
            if (commandTimeoutMillis > 0) {
                poolingClientConfig.commandTimeout(Duration.ofMillis(commandTimeoutMillis));
                LOGGER.trace("Redis configuration: commandTimeout is set to [{}]ms", commandTimeoutMillis);
            }
        }

        val clientOptions = newClientOptions(redis, casSslContext);
        poolingClientConfig.clientOptions(clientOptions);

        val pool = redis.getPool();
        if (pool != null && pool.isEnabled()) {
            val config = new GenericObjectPoolConfig();
            config.setMaxTotal(pool.getMaxActive());
            config.setMaxIdle(pool.getMaxIdle());
            config.setMinIdle(pool.getMinIdle());
            config.setMaxWait(Beans.newDuration(pool.getMaxWait()));
            config.setLifo(pool.isLifo());
            config.setFairness(pool.isFairness());
            config.setTestWhileIdle(pool.isTestWhileIdle());
            config.setTestOnBorrow(pool.isTestOnBorrow());
            config.setTestOnReturn(pool.isTestOnReturn());
            config.setTestOnCreate(pool.isTestOnCreate());
            if (pool.getMinEvictableIdleTimeMillis() > 0) {
                config.setMinEvictableIdleTime(Duration.ofMillis(pool.getMinEvictableIdleTimeMillis()));
            }
            if (pool.getNumTestsPerEvictionRun() > 0) {
                config.setNumTestsPerEvictionRun(pool.getNumTestsPerEvictionRun());
            }
            if (pool.getSoftMinEvictableIdleTimeMillis() > 0) {
                config.setSoftMinEvictableIdleTime(Duration.ofMillis(pool.getSoftMinEvictableIdleTimeMillis()));
            }
            poolingClientConfig.poolConfig(config);
            LOGGER.trace("Redis configuration: the pool is configured to [{}]", config);
        }
        return poolingClientConfig.build();
    }
New redis connection factory.

@param redis         the redis
@param initialize    the initialize
@param casSslContext the cas ssl context
@return the redis connection factory
support/cas-server-support-redis-core/src/main/java/org/apereo/cas/redis/core/RedisObjectFactory.java