Commit c1451f16 authored by Nigel McNie's avatar Nigel McNie
Browse files

A whole bunch more error reporting for SSO setup.



Although it isn't propogated up to the UI, it'll end up in Mahara's error log, which will help debugging.

The class of errors this catches is mainly to do with having invalid ssl keys on the remote host.
Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 2916f8a9
......@@ -576,6 +576,7 @@ function get_public_key($uri, $application=null) {
if (strpos($uri, $host) !== false) {
return $keyarray[$uri];
}
throw new XmlrpcClientException('The remote site sent us a key that is valid for ' . $host . ' instead of their hostname (' . $uri . ')', 500);
}
} else {
throw new XmlrpcClientException($res['faultString'], $res['faultCode']);
......
......@@ -841,6 +841,7 @@ class PluginAuthXmlrpc extends PluginAuth {
try {
$peer->bootstrap($values['wwwroot'], null, $values['appname'], $values['institution']);
} catch (RemoteServerException $e) {
log_debug($e->getMessage());
$form->set_error('wwwroot',get_string('cantretrievekey', 'auth'));
}
}
......
......@@ -240,10 +240,10 @@ class Peer {
throw new RemoteServerException('Networking is disabled on the host at '.$this->wwwroot.'.');
}
else {
throw new RemoteServerException('Error retrieving public key, failed with error code: '. $errcode);
throw new RemoteServerException('Error retrieving public key, failed with error code ' . $errcode . ': ' . $e->getMessage());
}
} catch (Exception $e) {
throw new RemoteServerException('Error retrieving public key ');
throw new RemoteServerException('Error retrieving public key: ' . $e->getMessage());
}
} else {
$this->publickey = new PublicKey($pubkey, $this->wwwroot);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment