Hello,
I had a memorystore redis instance set up with auth and was able to connect to ir perfectly with redispy from a vm, with redis-cli and from a redisinsight deployed in gke.
I have now recreated the instance but with tls encryption and I am failing to connect from all three. I have tried using the server-ca and self signed certs but have not found success. I am a bit lost here I don't know if I am approaching this correctly or if I missed something, so I would greatly appreciate it if someone could share some guidance on how to connect when tls is enabled.
Thanks
Solved! Go to Solution.
Connecting to a Google Cloud Memorystore for Redis instance with TLS encryption requires a few additional steps and configurations compared to a non-TLS setup:
Prerequisites:
Connecting to Your TLS-Enabled Redis Instance:
1. Using redis-cli
Download Certificates: Get the server CA certificate from your Google Cloud console.
Command Line:
redis-cli --tls --cacert <path-to-server-ca> -h <redis-host> -p <redis-port> -a <your-password>
<path-to-server-ca>
, <redis-host>
, <redis-port>
, and <your-password>
with the correct values for your instance.--auth
option is not valid. Use -a
for password authentication.2. Using RedisPy (Python)
Python Code:
import redis
redis_client = redis.StrictRedis(
host='your-redis-host',
port=your-redis-port,
password='your-password',
ssl=True,
ssl_ca_certs='path/to/server-ca.crt'
)
3. Using RedisInsight
Troubleshooting Tips:
Additional Notes:
redis-cli
, redis-py
, and RedisInsight.Connecting to a Google Cloud Memorystore for Redis instance with TLS encryption requires a few additional steps and configurations compared to a non-TLS setup:
Prerequisites:
Connecting to Your TLS-Enabled Redis Instance:
1. Using redis-cli
Download Certificates: Get the server CA certificate from your Google Cloud console.
Command Line:
redis-cli --tls --cacert <path-to-server-ca> -h <redis-host> -p <redis-port> -a <your-password>
<path-to-server-ca>
, <redis-host>
, <redis-port>
, and <your-password>
with the correct values for your instance.--auth
option is not valid. Use -a
for password authentication.2. Using RedisPy (Python)
Python Code:
import redis
redis_client = redis.StrictRedis(
host='your-redis-host',
port=your-redis-port,
password='your-password',
ssl=True,
ssl_ca_certs='path/to/server-ca.crt'
)
3. Using RedisInsight
Troubleshooting Tips:
Additional Notes:
redis-cli
, redis-py
, and RedisInsight.