11Fixes for the server reachability test.
2- -  Do not apply HTTPs redirection for challenge used by the test.
3- -  Set the `User-Agent` to avoid 403 answer from site24x7.com.
4- -  Handle JSON parsing failure of the received body.
5- -  Better handling of different error cases.
6- --- a/backend/internal/certificate.js	2023-12-11 15:50:27.947677992 -0500 
7- +++ b/backend/internal/certificate.js	2023-12-11 16:00:10.953034576 -0500 
8- @@ -1163,6 +1163,7 @@ 
2+     - Do not apply HTTPs redirection for challenge used by the test.
3+     - Set the `User-Agent` to avoid 403 answer from site24x7.com.
4+     - Handle JSON parsing failure of the received body.
5+     - Better handling of different error cases.
6+ 
7+ diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js 
8+ index f68ef30..ecbb4bf 100644
9+ --- a/backend/internal/certificate.js 
10+ +++ b/backend/internal/certificate.js 
11+ @@ -1167,6 +1167,7 @@  const internalCertificate = {
912 			const options  = {
1013 				method:  'POST',
1114 				headers: {
1215+ 					'User-Agent':     'Mozilla/5.0',
1316 					'Content-Type':   'application/x-www-form-urlencoded',
1417 					'Content-Length': Buffer.byteLength(formBody)
1518 				}
16- @@ -1175 ,12 +1176 ,22 @@ 
19+ @@ -1179 ,12 +1180 ,22 @@  const internalCertificate = { 
1720
1821 					res.on('data', (chunk) => responseBody = responseBody + chunk);
1922 					res.on('end', function () {
@@ -40,7 +43,7 @@ Fixes for the server reachability test.
4043 					});
4144 				});
4245
43- @@ -1194 ,6 +1205 ,9 @@ 
46+ @@ -1198 ,6 +1209 ,9 @@  const internalCertificate = { 
4447 			if (!result) {
4548 				// Some error occurred while trying to get the data
4649 				return 'failed';
@@ -50,11 +53,14 @@ Fixes for the server reachability test.
5053 			} else if (`${result.responsecode}` === '200' && result.htmlresponse === 'Success') {
5154 				// Server exists and has responded with the correct data
5255 				return 'ok';
53- --- a/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf	2023-12-13 08:00:40.674589907 -0500 
54- +++ b/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf	2023-12-13 08:05:26.611112675 -0500 
55- @@ -1,3 +1,9 @@ 
56+ diff --git a/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf b/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf 
57+ index 15f0d28..aa52f33 100644
58+ --- a/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf 
59+ +++ b/docker/rootfs/etc/nginx/conf.d/include/force-ssl.conf 
60+ @@ -1,3 +1,10 @@ 
61+ + set $test "";
5662 if ($scheme = "http") {
57- + 	set $test H ;
63+ + 	set $test "H" ;
5864+ }
5965+ if ($request_uri = /.well-known/acme-challenge/test-challenge) {
6066+ 	set $test "${test}T";
0 commit comments