From 56048f8366319519fc0727d29c7c8a78396885c0 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 27 Sep 2010 10:16:28 +0000 Subject: [PATCH] MDL-24332 fixed https handling when using sslproxy - thanks djeeg --- lib/setuplib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/setuplib.php b/lib/setuplib.php index d18696ac616..f7a84be72f0 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -583,9 +583,14 @@ function initialise_fullme() { // $CFG->sslproxy specifies if external SSL appliance is used // (That is, the Moodle server uses http, with an external box translating everything to https). if (empty($CFG->sslproxy)) { - if ($rurl['scheme'] == 'http' and $wwwroot['scheme'] == 'https') { + if ($rurl['scheme'] === 'http' and $wwwroot['scheme'] === 'https') { print_error('sslonlyaccess', 'error'); } + } else { + if ($wwwroot['scheme'] !== 'https') { + throw new coding_exception('Must use https address in wwwroot when ssl proxy enabled!'); + } + $rurl['scheme'] === 'https'; // make moodle believe it runs on https, squid or something else it doing it } // $CFG->reverseproxy specifies if reverse proxy server used. -- 2.43.0