Login via HTTPS in Moodle 2.0 after login, loops infinately.

Login via HTTPS in Moodle 2.0 after login, loops infinately.

by Bryan Smith -
Number of replies: 2

We use https for login only and offload the ssl to a our load balancer. When i reenabled it after upgrading from 1.9 to 2.0, clicking the login button throws the page into an loop.

 

Any ideas?

Average of ratings: -
In reply to Bryan Smith

Re: Login via HTTPS in Moodle 2.0 after login, loops infinately.

by Brent Lee -
Hey Bryan, Add this to your config file: $CFG->sslproxy=true; I had same issue recently. --Brent
In reply to Brent Lee

Re: Login via HTTPS in Moodle 2.0 after login, loops infinately.

by Daniel Kaelin -

In order to use sslproxy=true you have to make sure to comment out the following lines in lib/setuplib.php. 

They are typically found around line 822

} /*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
} */

 

When using sslproxy Moodle expects the wwwroot to be HTTPS. If you are using HTTPS logins only you won't be setting your wwwroot to HTTPS. This suppresses the resulting error.