redis - add REDIS_SSL_VERIFY setting

This commit is contained in:
florian 2024-01-16 11:21:02 +01:00
parent 55450949fa
commit f38f775f3d
No known key found for this signature in database
GPG key ID: 93EE47CC3D061500
3 changed files with 13 additions and 0 deletions

View file

@ -25,6 +25,7 @@ function clusterstore:initialize(pool)
["REDIS_PORT"] = "",
["REDIS_DATABASE"] = "",
["REDIS_SSL"] = "",
["REDIS_SSL_VERIFY"] = "",
["REDIS_TIMEOUT"] = "",
["REDIS_KEEPALIVE_IDLE"] = "",
["REDIS_KEEPALIVE_POOL"] = "",
@ -57,6 +58,7 @@ function clusterstore:initialize(pool)
keepalive_poolsize = tonumber(self.variables["REDIS_KEEPALIVE_POOL"]),
connection_options = {
ssl = self.variables["REDIS_SSL"] == "yes",
ssl_verify = self.variables["REDIS_SSL_VERIFY"] == "yes",
},
host = self.variables["REDIS_HOST"],
port = tonumber(self.variables["REDIS_PORT"]),

View file

@ -50,6 +50,15 @@
"regex": "^(yes|no)$",
"type": "check"
},
"REDIS_SSL_VERIFY": {
"context": "global",
"default": "no",
"help": "Verify the certificate of Redis server.",
"id": "redis-ssl-verify",
"label": "Redis SSL/TLS verify",
"regex": "^(yes|no)$",
"type": "check"
},
"REDIS_TIMEOUT": {
"context": "global",
"default": "1000",

View file

@ -58,6 +58,7 @@ function sessions:init()
["REDIS_PORT"] = "",
["REDIS_DATABASE"] = "",
["REDIS_SSL"] = "",
["REDIS_SSL_VERIFY"] = "",
["REDIS_TIMEOUT"] = "",
["REDIS_KEEPALIVE_IDLE"] = "",
["REDIS_KEEPALIVE_POOL"] = "",
@ -124,6 +125,7 @@ function sessions:init()
pool = "bw-redis",
pool_size = tonumber(redis_vars["REDIS_KEEPALIVE_POOL"]),
ssl = redis_vars["REDIS_SSL"] == "yes",
ssl_verify = redis_vars["REDIS_SSL_VERIFY"] == "yes",
database = tonumber(redis_vars["REDIS_DATABASE"]),
}
if redis_vars["REDIS_SENTINEL_HOSTS"] ~= nil then