Forums | Mahara Community
Crosspost from Mahoodle forum. Problem with SSO
08 June 2012, 10:17
So as the subject implies, I have moodle and mahara running on windows server 2008, using IIS. I am trying to set up SSO, mostly because I want to pass information between the two. In fact, I would not even think about using mahara if it weren't for that feature.
I have set up openssl, which was fun, let me tell you. and networking is working in both products. Both sides have created public keys. I followed the mahoodle doc.
I know they are talking to each other, because the moodle side of things works correctly, but I can't get the institution added in mahara. When I try to set it up, I get the good ol'
"An error occurred while retrieving the public key from the remote server.
Please ensure that the Application and WWW Root fields are correct, and that networking is enabled on the remote host.
Error retrieving public key, failed with error code 0: Sorry, but that hostname (0) could not be resolved!"
error, and can't seem to resolve the problem. I know my wwwroot is right, and I know my dns works. I even went into my hosts file and mapped the ip address to moodle's wwwroot.
I checked my error logs, and here is the specific error:
[08-Jun-2012 14:47:04 UTC] [DBG] 8d (C:\inetpub\wwwroot\Mahara\auth\xmlrpc\lib.php:877) Error retrieving public key, failed with error code 0: Sorry, but that hostname (0) could not be resolved!
I have scoured the internet, and especially the moodle and mahara forums, and no one seems to have an answer for this that works. I am at a loss for what to do. Does anyone have any advice on this?
17 June 2012, 16:36
Error retrieving public key, failed with error code 0: Sorry, but that hostname (0) could not be resolved!
I've had a look at the code, and that error message is actually two different errors shown together:
Error retrieving public key, failed with error code 0
which is from Mahara, and:
Sorry, but that hostname (0) could not be resolved!
which is actually from Moodle! (it's the error message string Moodle is sending back to Mahara). So your problem actually lies in Moodle. This particular message appears in mnet/peer.php (under Moodle rootdir). It tries to get the peer (Mahara) IP address and fails.
You could modify mnet/peer.php (around line 59 in Moodle 2.x) and add a couple of debugging lines after these ones:
$hostname = mnet_get_hostname_from_uri($wwwroot);
// Get the IP address for that host - if this fails, it will return the hostname string
$ip_address = gethostbyname($hostname);
You could use error_log() to log both the $hostname and $ip_address values and see what could be going on.