Module: kamailio
Branch: master
Commit: 90f977202af2d132fb63f20f76f9ad696a19656e
URL:
https://github.com/kamailio/kamailio/commit/90f977202af2d132fb63f20f76f9ad6…
Author: Joel Centelles <joel_centellesmartin(a)baxter.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-06-20T10:45:31+02:00
ndb_redis: Fixing global variables names
Adding module name prefixing global variable names to prevent possible
conflicts. Also using ca_path info in SSL context creation.
---
Modified: src/modules/ndb_redis/ndb_redis_mod.c
Modified: src/modules/ndb_redis/redis_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/90f977202af2d132fb63f20f76f9ad6…
Patch:
https://github.com/kamailio/kamailio/commit/90f977202af2d132fb63f20f76f9ad6…
---
diff --git a/src/modules/ndb_redis/ndb_redis_mod.c
b/src/modules/ndb_redis/ndb_redis_mod.c
index 11d6cdb9c7..48c04a0bcc 100644
--- a/src/modules/ndb_redis/ndb_redis_mod.c
+++ b/src/modules/ndb_redis/ndb_redis_mod.c
@@ -55,7 +55,7 @@ int redis_flush_on_reconnect_param = 0;
int redis_allow_dynamic_nodes_param = 0;
int ndb_redis_debug = L_DBG;
#ifdef WITH_SSL
-char *ca_path = 0;
+char *ndb_redis_ca_path = 0;
#endif
static int w_redis_cmd3(
@@ -136,7 +136,7 @@ static param_export_t params[] = {
{"allow_dynamic_nodes", INT_PARAM, &redis_allow_dynamic_nodes_param},
{"debug", PARAM_INT, &ndb_redis_debug},
#ifdef WITH_SSL
- {"ca_path", PARAM_STRING, &ca_path},
+ {"ca_path", PARAM_STRING, &ndb_redis_ca_path},
#endif
{0, 0, 0}};
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 00b01c9596..39b33d2066 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -63,7 +63,7 @@ extern int redis_flush_on_reconnect_param;
extern int redis_allow_dynamic_nodes_param;
extern int ndb_redis_debug;
#ifdef WITH_SSL
-extern char *ca_path;
+extern char *ndb_redis_ca_path;
#endif
/* backwards compatibility with hiredis < 0.12 */
@@ -237,7 +237,7 @@ int redisc_init(void)
/* Create SSL context*/
redisInitOpenSSL();
rsrv->sslCtxRedis =
- redisCreateSSLContext(NULL, NULL, NULL, NULL, NULL, NULL);
+ redisCreateSSLContext(NULL, ndb_redis_ca_path, NULL, NULL, NULL, NULL);
if(rsrv->sslCtxRedis == NULL) {
LM_ERR("Unable to create Redis TLS Context.\n");
}
@@ -599,7 +599,7 @@ int redisc_reconnect_server(redisc_server_t *rsrv)
/* Create SSL context*/
redisInitOpenSSL();
rsrv->sslCtxRedis =
- redisCreateSSLContext(NULL, NULL, NULL, NULL, NULL, NULL);
+ redisCreateSSLContext(NULL, ndb_redis_ca_path, NULL, NULL, NULL, NULL);
if(rsrv->sslCtxRedis == NULL) {
LM_ERR("Unable to create Redis TLS Context.\n");
}