Ignore TLS/SSL error for Redis (#3878)

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
HdroguettA 2024-05-20 07:34:01 +10:00 committed by GitHub
parent 55b2d4b907
commit daca38a554
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 6 deletions

View file

@ -486,12 +486,16 @@ exports.radius = function (
/**
* Redis server ping
* @param {string} dsn The redis connection string
* @returns {Promise<any>} Response from redis server
* @param {boolean} rejectUnauthorized If false, allows unverified server certificates.
* @returns {Promise<any>} Response from server
*/
exports.redisPingAsync = function (dsn) {
exports.redisPingAsync = function (dsn, rejectUnauthorized) {
return new Promise((resolve, reject) => {
const client = redis.createClient({
url: dsn
url: dsn,
socket: {
rejectUnauthorized
}
});
client.on("error", (err) => {
if (client.isOpen) {