csredis icon indicating copy to clipboard operation
csredis copied to clipboard

Redis服務使用utils/gen-test-certs.sh生成证书並啟用了TLS,new CSRedisClient(ssl=true) 后获取Key值报错

Open hkszlq opened this issue 3 years ago • 3 comments

请问CSRedis有无接口示例代码或者如何配置证书?

Code: var csredis = new CSRedisClient("192.168.8.111:6379,ssl=true"); RedisHelper.Initialization(csredis); Console.WriteLine(csredis.Get("name")); Exception error: 3)System.Exception:“【192.168.8.111:6379/0】状态不可用,等待后台检查程序恢复方可使用。One or more errors occurred. (Authentication failed because the remote party sent a ### TLS alert: 'HandshakeFailure'.)” 2)AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'. 1)Win32Exception: 接收到的消息异常,或格式不正确。

hkszlq avatar Mar 01 '22 03:03 hkszlq

Redis.config TLS: tls-cert-file /etc/redis/ssl/redis.crt tls-key-file /etc/redis/ssl/redis.key tls-ca-cert-file /etc/redis/ssl/ca.crt tls-dh-params-file /etc/redis/ssl/redis.dh tls-auth-clients yes tls-replication yes

Redis login: redis-cli --tls --cert /etc/redis/ssl/redis.crt --key /etc/redis/ssl/redis.key --cacert /etc/redis/ssl/ca.crt -p 6379 127.0.0.1:6379> get "name" "namevalue"

hkszlq avatar Mar 01 '22 05:03 hkszlq

这个问题解决了吗,大哥,我在并发下源码也抛出了 状态不可用,等待后台检查程序恢复方可使用。One or more errors occurred.

tangehan avatar Mar 10 '22 13:03 tangehan

检查程序恢复方可使用

沒有呢,按Redis官方的.sh生成的自簽名證書默認是雙向驗證的,貌似當前CSRedis版本並沒有相關的證書設置API

hkszlq avatar Mar 10 '22 15:03 hkszlq