Hands-on task
TLS for Redis with your own CA
Traffic to Redis goes in plain text — passwords and data are visible to anyone sniffing the network. Enable TLS on a separate port without breaking the old one.
- In
/etc/redis/tls/, generate your own certificate authority —ca.keyand a self-signedca.crt. - Issue a server key
redis.keyand a certificateredis.crtsigned by this CA (not self-signed) for the namelocalhostor the address127.0.0.1. - The key
redis.keymust be readable by theredisuser but not readable by everyone else. - In
/etc/redis/redis.confenable TLS on port 6380 (the regular port 6379 keeps working), don't require client certificates. Restart Redis.
Result: redis-cli -p 6380 --tls --cacert /etc/redis/tls/ca.crt ping replies PONG, and a client without TLS can't get through on 6380.
- redis
- TLS
- openssl
- PKI
- certificate authority
- tls-port