How to loading a cluster configuration by name with tls? · Issue #2805 · phpredis/phpredis · GitHub
Skip to content

How to loading a cluster configuration by name with tls? #2805

@PorraphitChuasuk

Description

@PorraphitChuasuk

Based on the documentation for loading a cluster configuration by name: https://github.com/phpredis/phpredis/blob/93cb921158da4d1342a5ca291dcf4d68a54a2048/cluster.md#loading-a-cluster-configuration-by-name

# In redis.ini
redis.clusters.seeds = "mycluster[]=localhost:7000&test[]=localhost:7001"
redis.clusters.timeout = "mycluster=5"
redis.clusters.read_timeout = "mycluster=10"
redis.clusters.auth = "mycluster=password"

For the session handler, stream context options (such as TLS settings) can be passed via:
https://github.com/phpredis/phpredis/blob/93cb921158da4d1342a5ca291dcf4d68a54a2048/cluster.md#session-handler

session.save_handler = rediscluster
session.save_path = "seed[]=host1:port1&seed[]=host2:port2&seed[]=hostN:portN&timeout=2&read_timeout=2&failover=error&persistent=1&auth=password&stream[verify_peer]=0"

Note the use of stream[verify_peer]=0 at the end to control TLS verification.

Question

How can stream context options (e.g. stream[verify_peer]) be configured when using a named cluster configuration (redis.clusters.*)?

For example, is the following configuration valid for applying stream options to a named cluster?

# In redis.ini
redis.clusters.seeds = "mycluster[]=tls://c1.cache.amazonaws.com:6379&stream[verify_peer]=0&test[]=tls://c2.cache.amazonaws.com:6379&stream[verify_peer]=1"
redis.clusters.timeout = "mycluster=5"
redis.clusters.read_timeout = "mycluster=10"
redis.clusters.auth = "mycluster=password"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions