Search code examples
phpamazon-web-servicesredisamazon-elasticache

PHP Session handler Redis - AWS ElastiCache Encryption in-transit


I've tried to setup PHP session handler Redis.

session.save_handler = redis
session.save_path = "tcp://xxx.cache.amazonaws.com:6379"

This works well, but when Encryption in-transit is enabled, then it fails on

Failed to read session data: redis

In that case connection string contained auth param

?auth=12345

Is there any trick which I've missed


Solution

  • Ok, not documented very well, but https://github.com/phpredis/phpredis/issues/1657 pointed me in right direction, solution is simple, use tls scheme

    session.save_path = "tls://xxx.cache.amazonaws.com:6379?auth=12345"