Merge pull request #12895 from nextcloud/bugfix/12890/log-openssl-errors
Read openssl error and log
This commit is contained in:
commit
6f00798c11
|
@ -295,6 +295,10 @@ class PublicKeyTokenProvider implements IProvider {
|
||||||
|
|
||||||
// Generate new key
|
// Generate new key
|
||||||
$res = openssl_pkey_new($config);
|
$res = openssl_pkey_new($config);
|
||||||
|
if ($res === false) {
|
||||||
|
$this->logOpensslError();
|
||||||
|
}
|
||||||
|
|
||||||
openssl_pkey_export($res, $privateKey);
|
openssl_pkey_export($res, $privateKey);
|
||||||
|
|
||||||
// Extract the public key from $res to $pubKey
|
// Extract the public key from $res to $pubKey
|
||||||
|
@ -343,5 +347,11 @@ class PublicKeyTokenProvider implements IProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function logOpensslError() {
|
||||||
|
$errors = [];
|
||||||
|
while ($error = openssl_error_string()) {
|
||||||
|
$errors[] = $error;
|
||||||
|
}
|
||||||
|
$this->logger->critical('Something is wrong with your openssl setup: ' . implode(', ', $errors));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue