Added boolean flag which enables ssl connection for redis nodes.
This is needed for example connecting to the azure redis sever.
This commit is contained in:
parent
6dc7508968
commit
871dea249c
|
|
@ -35,6 +35,11 @@ class RedisCacheApi implements INodeCredential {
|
||||||
name: 'redisCachePwd',
|
name: 'redisCachePwd',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
placeholder: '<REDIS_PASSWORD>'
|
placeholder: '<REDIS_PASSWORD>'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Use SSL',
|
||||||
|
name: 'redisCacheSslEnabled',
|
||||||
|
type: 'boolean'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,12 +56,16 @@ class RedisCache implements INode {
|
||||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||||
|
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||||
|
|
||||||
|
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {};
|
||||||
|
|
||||||
client = new Redis({
|
client = new Redis({
|
||||||
port: portStr ? parseInt(portStr) : 6379,
|
port: portStr ? parseInt(portStr) : 6379,
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
...tlsOptions
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
client = new Redis(redisUrl)
|
client = new Redis(redisUrl)
|
||||||
|
|
|
||||||
|
|
@ -71,12 +71,16 @@ class RedisEmbeddingsCache implements INode {
|
||||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||||
|
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||||
|
|
||||||
|
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {};
|
||||||
|
|
||||||
client = new Redis({
|
client = new Redis({
|
||||||
port: portStr ? parseInt(portStr) : 6379,
|
port: portStr ? parseInt(portStr) : 6379,
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
...tlsOptions
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
client = new Redis(redisUrl)
|
client = new Redis(redisUrl)
|
||||||
|
|
|
||||||
|
|
@ -103,12 +103,16 @@ const initalizeRedis = async (nodeData: INodeData, options: ICommonObject): Prom
|
||||||
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
const password = getCredentialParam('redisCachePwd', credentialData, nodeData)
|
||||||
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
const portStr = getCredentialParam('redisCachePort', credentialData, nodeData)
|
||||||
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
const host = getCredentialParam('redisCacheHost', credentialData, nodeData)
|
||||||
|
const sslEnabled = getCredentialParam('redisCacheSslEnabled', credentialData, nodeData)
|
||||||
|
|
||||||
|
const tlsOptions = sslEnabled === true ? { tls: { rejectUnauthorized: false } } : {};
|
||||||
|
|
||||||
client = new Redis({
|
client = new Redis({
|
||||||
port: portStr ? parseInt(portStr) : 6379,
|
port: portStr ? parseInt(portStr) : 6379,
|
||||||
host,
|
host,
|
||||||
username,
|
username,
|
||||||
password
|
password,
|
||||||
|
...tlsOptions
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
client = new Redis(redisUrl)
|
client = new Redis(redisUrl)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue