more error messages which might be useful for the user to debug his server config

This commit is contained in:
Bjoern Schiessle 2013-08-01 15:52:00 +02:00
parent 7ce03ba37c
commit b39d2d1938
2 changed files with 6 additions and 2 deletions

View File

@ -57,7 +57,9 @@ class Crypt {
if ($res === false) {
\OCP\Util::writeLog('Encryption library', 'couldn\'t generate users key-pair for ' . \OCP\User::getUser(), \OCP\Util::ERROR);
\OCP\Util::writeLog('Encryption library', openssl_error_string(), \OCP\Util::ERROR);
while ($msg = openssl_error_string()) {
\OCP\Util::writeLog('Encryption library', 'openssl_pkey_new() fails: ' . $msg, \OCP\Util::ERROR);
}
} elseif (openssl_pkey_export($res, $privateKey)) {
// Get public key
$keyDetails = openssl_pkey_get_details($res);

View File

@ -241,7 +241,9 @@ class Helper {
if(openssl_pkey_new(array('private_key_bits' => 4096))) {
return true;
} else {
\OCP\Util::writeLog('Encryption library', 'openssl_pkey_new()fails: ' . openssl_error_string(), \OCP\Util::ERROR);
while ($msg = openssl_error_string()) {
\OCP\Util::writeLog('Encryption library', 'openssl_pkey_new() fails: ' . $msg, \OCP\Util::ERROR);
}
return false;
}
}