【Azure Redis】Redis-CLI连接Redis 6380端口始终遇见 I/O Error
问题描述
使用Redis-cli连接Redis服务,因为工具无法直接支持TLS 6380端口连接,所以需要使用 stunnel 配置TLS/SSL服务。根据文章(Linux VM使用6380端口(SSL方式)连接Azure Redis (redis-cli & stunnel) : https://www.cnblogs.com/lulight/p/14188279.html),配置stunnel后,始终无法连接成功。报错 I/O Error.

问题解答
检查Redis的6380端口连通性 (paping xxxx.redis.cache.chinacloudapi.cn -p 6380) , 成功。排除Redis服务端问题。

再次检查客户端配置,特别是stunnel的config文件,对比发现,一个失误,引发的问题:

对比发现两处错误:
1)没有指定service_name,因为是使用redis-cli工具调用stunnel代理隧道进行TLS/SSL,所以这里的[service_name]需要替换为[redis-cli]
2)缺少了 client = yes 配置
在添加以上配置后,再次测试 redis-cli 连接 6380 端口,成功!
参考资料
Linux VM使用6380端口(SSL方式)连接Azure Redis (redis-cli & stunnel) : https://www.cnblogs.com/lulight/p/14188279.html
Using stunnel: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-using_stunnel
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

喜欢的朋友记得点赞、收藏、关注哦!!!