Mahoodle - SSL Certificate

Mahoodle - SSL Certificate

by Phill Pover -
Number of replies: 19

I managed to get Mahara built and working and am now trying to get the SSO working. Mahara keeps throwing an error:

The Colne: Site unavailable

A nonrecoverable error occured. This probably means you have encountered a bug in the system

I checked the apache logs on Mahara's Linux server (This is my first foray into Linux servers, but I think I managed to get it set up properly) and it's complaining that the SSL Certificate is invalid. I assumed that this was because it's a self signed certificate, so I commented out that check in Mahara's XMLRPC/lib.php and then it threw another error complaining that the certificate's common name (CN) is blank, so does not compare to to URL of the moodle site. I've checked the certificate and it definitely has the address of the site there (doesn't have the http:// at the beginning, but at the moment that doesn't matter, can sort that later).

After that, thought 'what the hey' and commented out the CN check just to see what would happen. Mahara then threw an unhandled error, so I put all that code back in play and decided to stop fiddling for a while.

Has anyone come across this and know how to get around it? Or is it just a problem with the fact that I have a self signed SSL certificate?

-Phill
Average of ratings: -
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Nigel McNie -
Hi Phill,

I can assure you that this error has nothing to do with the SSL certificate being self-signed. MNET makes no distinction at this level.

If Mahara is complaining that the certificate is invalid, this might mean that...
  1. Mahara received rubbish when it asked Moodle for the key
  2. The certificate it got from Moodle was bad for some other reason - maybe it had already expired in Moodle
  3. Some other bug in either Mahara or Moodle
In any case, Mahara should never show you the nonrecoverable error screen, so there is a bug in there somewhere smile. But this bug is being triggered by apparently receiving bogus data from Moodle. When you visit the Networking page for Moodle, what do you see in the 'public key' field? Can you try clicking 'delete this key' and getting a new one, and then seeing if you can set up SSO again?

Also, have you seen the Mahoodle documentation? Google for it if you haven't it's very helpful.
Average of ratings:Useful (1)
In reply to Nigel McNie

Re: Mahoodle - SSL Certificate

by Phill Pover -
I've been following the Mahoodle docs from the beginning. Tried recreating the key and recreated the peer settings, still the same error. Recreated the login settings in Mahara, still nothing.

Full error log from apache:
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] [DBG] 0b (auth/user.php:598) Destroying user with un-committed changes, referer: http://moodle.colne.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] [WAR] 0b (api/xmlrpc/lib.php:903) This is not a valid SSL Certificate, referer: http://moodle.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] Call stack (most recent first):, referer: http://moodle.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] * PublicKey->__construct("", "http://moodle.colne.essex.sch.uk") at /htdocs/mahara/lib/peer.php:111, referer: http://moodle.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] * Peer->findByWwwroot("http://moodle.colne.essex.sch.uk") at /htdocs/mahara/api/xmlrpc/lib.php:454, referer: http://moodle.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] * get_peer("http://moodle.colne.essex.sch.uk") at /htdocs/mahara/auth/xmlrpc/lib.php:105, referer: http://moodle.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] * AuthXmlrpc->request_user_authorise("0ff2d6a30e1311dc9546c40142fde0474808b89d", "http://moodle.colne.essex.sch.uk") at /htdocs/mahara/auth/xmlrpc/land.php:101, referer: http://moodle.colne.essex.sch.uk/
[Wed Nov 26 12:00:49 2008] [error] [client 10.35.110.232] , referer: http://moodle.colne.essex.sch.uk/
Any ideas?
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Nigel McNie -
Something is wrong there, because it looks like Mahara has saved an empty string as the public key:

PublicKey->__construct("", "http://moodle.colne.essex.sch.uk") at /htdocs/mahara/lib/peer.php:111

Can you re check the xmlrpc authinstance configuration in Mahara? Maybe even delete and re-create it.

And what versions of moodle and mahara are you using?
In reply to Nigel McNie

Re: Mahoodle - SSL Certificate

by Phill Pover -
Done that several times now, but even when I click on the XMLRPC authinstance link in the institution I get the error message. I'm using moodle 1.9.3 and Mahara 1.0.4. As I said, this was my first time setting up a Linux server, so it's quite possible that I've set something up incorrectly.

Thanks for helping BTW smile
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Nigel McNie -
Ah, I think the first thing you should do is upgrade to Mahara 1.0.6, then try again from scratch. We put a lot of work into SSO for Mahara 1.0.5.
In reply to Nigel McNie

Re: Mahoodle - SSL Certificate

by Phill Pover -
when will it be in apt-get? or is there an easy way of upgrading?
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
Well, I've found it's in apt-get, but whenever I try to download mahara it gets 1.0.4 not 1.0.6!? any idea how to get the right one?
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
OK scratch that. downloaded it manually and trying again...
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
New and longer error message:

[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] [WAR] 6a (lib/peer.php:183) file_get_contents(http://moodle.colne.essex.sch.uk) [function.file-get-contents]: failed to open stream: Connection timed out, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] Call stack (most recent first):, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * log_message("file_get_contents(http://moodle.colne.essex.sch.uk...", 8, true, true, "/htdocs/mahara/lib/peer.php", 183) at /htdocs/mahara/lib/errors.php:374, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * error(2, "file_get_contents(http://moodle.colne.essex.sch.uk...", "/htdocs/mahara/lib/peer.php", 183, array(size 6)) at Unknown:0, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * file_get_contents("http://moodle.colne.essex.sch.uk") at /htdocs/mahara/lib/peer.php:183, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * Peer->bootstrap("http://moodle.colne.essex.sch.uk", null, "moodle", "colne") at /htdocs/mahara/auth/xmlrpc/lib.php:833, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * PluginAuthXmlrpc::validate_config_options(array(size 19), object(Pieform)) at Unknown:0, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * call_user_func_array(array(size 2), array(size 2)) at /htdocs/mahara/lib/mahara.php:934, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * call_static_method("PluginAuthXmlrpc", "validate_config_options", array(size 19), object(Pieform)) at /htdocs/mahara/admin/users/addauthority.php:110, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * auth_config_validate(object(Pieform), array(size 19)) at Unknown:0, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * call_user_func_array("auth_config_validate", array(size 2)) at /htdocs/mahara/lib/pieforms/pieform.php:1200, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * Pieform->validate(array(size 19)) at /htdocs/mahara/lib/pieforms/pieform.php:410, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * Pieform->__construct(array(size 5)) at /htdocs/mahara/lib/pieforms/pieform.php:170, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * Pieform::process(array(size 5)) at /htdocs/mahara/lib/pieforms/pieform.php:71, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] * pieform(array(size 5)) at /htdocs/mahara/admin/users/addauthority.php:97, referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
[Thu Nov 27 13:14:05 2008] [error] [client 10.35.110.232] , referer: http://10.35.108.61/admin/users/addauthority.php?add=1&i=colne&p=xmlrpc
Is this a firewall issue or something? It just doesn't seem to want to communicate with moodle.
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
Well, to answer my own question, I've sorted out the firewall on the mahara server, and there isn't a firewall on the moodle server (which is windows server 2000 BTW). Still the same problem. I've tried starting this connection process from the beginning again, still no success. Really confused now...
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Nigel McNie -
sad it seems like its busted... I'm afraid I have run out of ideas too!
In reply to Nigel McNie

Re: Mahoodle - SSL Certificate

by Phill Pover -
A thought occurs, the mahara server connects to the internet via a proxy server, but the moodle server is on the same network. Do I need to put in some sort of bypass for this in linux somewhere? If so, do you know how I might go about this?
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
Found the problem, should've looked at moodle's apache logs:

[Fri Nov 28 11:02:33 2008] [error] [client 10.35.108.61] File does not exist: C:/xampp/htdocs/mnet


It really shouldn't be looking for it there. It's in c:\xampp\htdocs\moodle\mnet. Where is this function called? Is it moodle or mahara calling this?

In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Nigel McNie -
That sounds like you've got the wwwroot set up wrong in Mahara - it should be http://domain/moodle/ rather than http://domain/ perhaps?
In reply to Nigel McNie

Re: Mahoodle - SSL Certificate

by Phill Pover -
Right, I seem to have got it to look in the right place for moodle now, but it's complaining that it can't find a file 'htdocs/moodle/crossdomain.xml'. I've tried searching for it, but it doesn't exist. Should this exist?
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
Sorted out the crossdomain.xml, but it's still not working. Mahara is now giving an 'Access Denied. You do not have access to view this page. Networking is disabled on this site ' error. I checked the error logs of the mahara and moodle servers, and all there seems to be is a line in the access log on moodle:

94.101.160.1 - - [01/Dec/2008:08:47:18 +0000] "GET /auth/mnet/jump.php?hostid=4 HTTP/1.0" 303 404
Any ideas?
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Phill Pover -
Well, I got fed up, deleted mahara, reinstalled and tried again, and somehow it all works. Thanks for your help.
In reply to Phill Pover

Re: Mahoodle - SSL Certificate

by Nigel McNie -
It won't be in apt-get for debian lenny now, they've frozen for release. It is in debian unstable however.