Skip to content

Commit 38ec0f9

Browse files
committed
Adds logs to backend when testing http challenge
1 parent 9efe6cf commit 38ec0f9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backend/internal/certificate.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1181,16 +1181,20 @@ const internalCertificate = {
11811181
// Server exists and has responded with the correct data
11821182
return 'ok';
11831183
} else if (`${result.responsecode}` === '200') {
1184-
// Server exists and has responded with the correct data
1184+
// Server exists but has responded with wrong data
1185+
logger.info(`HTTP challenge test failed for domain ${domain} because of invalid returned data:`, result.htmlresponse);
11851186
return 'wrong-data';
11861187
} else if (`${result.responsecode}` === '404') {
11871188
// Server exists but responded with a 404
1189+
logger.info(`HTTP challenge test failed for domain ${domain} because code 404 was returned`);
11881190
return '404';
11891191
} else if (`${result.responsecode}` === '0' || (typeof result.reason === 'string' && result.reason.toLowerCase() === 'host unavailable')) {
11901192
// Server does not exist at domain
1193+
logger.info(`HTTP challenge test failed for domain ${domain} the host was not found`);
11911194
return 'no-host';
11921195
} else {
11931196
// Other errors
1197+
logger.info(`HTTP challenge test failed for domain ${domain} because code ${result.responsecode} was returned`);
11941198
return `other:${result.responsecode}`;
11951199
}
11961200
}

0 commit comments

Comments
 (0)