Skip to content

Commit

Permalink
MDL-24332 fixed https handling when using sslproxy - thanks djeeg
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 27, 2010
1 parent bc31625 commit 56048f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/setuplib.php
Expand Up @@ -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.
Expand Down

0 comments on commit 56048f8

Please sign in to comment.