feat(redis): support TLS for Redis connections (#1930)
[Feature]: Support TLS for Redis connections
This commit is contained in:
@@ -52,6 +52,7 @@ import (
|
||||
"github.com/Tencent/WeKnora/internal/application/service/file"
|
||||
memoryService "github.com/Tencent/WeKnora/internal/application/service/memory"
|
||||
"github.com/Tencent/WeKnora/internal/application/service/retriever"
|
||||
"github.com/Tencent/WeKnora/internal/common"
|
||||
"github.com/Tencent/WeKnora/internal/config"
|
||||
"github.com/Tencent/WeKnora/internal/database"
|
||||
"github.com/Tencent/WeKnora/internal/datasource"
|
||||
@@ -439,10 +440,11 @@ func initRedisClient() (*redis.Client, error) {
|
||||
}
|
||||
|
||||
client := redis.NewClient(&redis.Options{
|
||||
Addr: redisAddr,
|
||||
Username: os.Getenv("REDIS_USERNAME"),
|
||||
Password: os.Getenv("REDIS_PASSWORD"),
|
||||
DB: db,
|
||||
Addr: redisAddr,
|
||||
Username: os.Getenv("REDIS_USERNAME"),
|
||||
Password: os.Getenv("REDIS_PASSWORD"),
|
||||
DB: db,
|
||||
TLSConfig: common.RedisTLSConfig(),
|
||||
})
|
||||
|
||||
_, err = client.Ping(context.Background()).Result()
|
||||
|
||||
Reference in New Issue
Block a user