diff --git a/server/model/monitor.js b/server/model/monitor.js index 69b685c7..1b11c614 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -852,7 +852,7 @@ class Monitor extends BeanModel { } else if (this.type === "redis") { let startTime = dayjs().valueOf(); - bean.msg = await redisPingAsync(this.databaseConnectionString); + bean.msg = await redisPingAsync(this.databaseConnectionString, !this.ignoreTls); bean.status = UP; bean.ping = dayjs().valueOf() - startTime; diff --git a/server/util-server.js b/server/util-server.js index d728b6c2..f425ac7f 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -486,12 +486,16 @@ exports.radius = function ( /** * Redis server ping * @param {string} dsn The redis connection string - * @returns {Promise} Response from redis server + * @param {boolean} rejectUnauthorized If false, allows unverified server certificates. + * @returns {Promise} 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) { diff --git a/src/lang/en.json b/src/lang/en.json index d5cdec06..d3752706 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -80,6 +80,7 @@ "resendDisabled": "Resend disabled", "retriesDescription": "Maximum retries before the service is marked as down and a notification is sent", "ignoreTLSError": "Ignore TLS/SSL errors for HTTPS websites", + "ignoreTLSErrorGeneral": "Ignore TLS/SSL error for connection", "upsideDownModeDescription": "Flip the status upside down. If the service is reachable, it is DOWN.", "maxRedirectDescription": "Maximum number of redirects to follow. Set to 0 to disable redirects.", "Upside Down Mode": "Upside Down Mode", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 38017778..0533eb0f 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -508,10 +508,10 @@ -
+