From 38ec0f9f957b34bd856879faa1422da2a0772c66 Mon Sep 17 00:00:00 2001 From: Julian Reinhardt Date: Thu, 4 Nov 2021 11:16:23 +0100 Subject: [PATCH] Adds logs to backend when testing http challenge --- backend/internal/certificate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js index 6161ce2d..3fb559cc 100644 --- a/backend/internal/certificate.js +++ b/backend/internal/certificate.js @@ -1181,16 +1181,20 @@ const internalCertificate = { // Server exists and has responded with the correct data return 'ok'; } else if (`${result.responsecode}` === '200') { - // Server exists and has responded with the correct data + // Server exists but has responded with wrong data + logger.info(`HTTP challenge test failed for domain ${domain} because of invalid returned data:`, result.htmlresponse); return 'wrong-data'; } else if (`${result.responsecode}` === '404') { // Server exists but responded with a 404 + logger.info(`HTTP challenge test failed for domain ${domain} because code 404 was returned`); return '404'; } else if (`${result.responsecode}` === '0' || (typeof result.reason === 'string' && result.reason.toLowerCase() === 'host unavailable')) { // Server does not exist at domain + logger.info(`HTTP challenge test failed for domain ${domain} the host was not found`); return 'no-host'; } else { // Other errors + logger.info(`HTTP challenge test failed for domain ${domain} because code ${result.responsecode} was returned`); return `other:${result.responsecode}`; } }