From 098b16fb13bdce41b598b7d7641c828f0f2646d6 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 31 Oct 2017 11:57:25 +0100 Subject: [PATCH] MDL-60634 tool_mobile: Change page used for https test We need to do the HTTPS check using a page that: - Does not redirect (login/index.php may redirect because of auth plugins) - Does not return moodle exceptions (some custom exceptions handlers may launch custom HTTP errors) --- admin/tool/mobile/classes/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/tool/mobile/classes/api.php b/admin/tool/mobile/classes/api.php index bfc42ee0226..b53aaaf7171 100644 --- a/admin/tool/mobile/classes/api.php +++ b/admin/tool/mobile/classes/api.php @@ -386,7 +386,8 @@ class api { // Return certificate information and verify the certificate. $curl->setopt(array('CURLOPT_CERTINFO' => 1, 'CURLOPT_SSL_VERIFYPEER' => true)); $httpswwwroot = str_replace('http:', 'https:', $CFG->wwwroot); // Force https url. - $curl->head($httpswwwroot . "/login/index.php"); + // Check https using a page not redirecting or returning exceptions. + $curl->head($httpswwwroot . "/$CFG->admin/tool/mobile/mobile.webmanifest.php"); $info = $curl->get_info(); // First of all, check the server certificate (if any).