summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-12-07 09:41:47 +0100
committerGitHub <noreply@github.com>2018-12-07 09:41:47 +0100
commit6f00798c11e93567720a2de281542ce4ca42d7b3 (patch)
tree100f818e8fac609af3985c9a32aa6fa43d6f090e /lib
parent14dc979ec8446322b52f443e0e303c13aff5da56 (diff)
parentec8aefc7621fd81fab02184a29d7f13c71ba4c65 (diff)
downloadnextcloud-server-6f00798c11e93567720a2de281542ce4ca42d7b3.tar.gz
nextcloud-server-6f00798c11e93567720a2de281542ce4ca42d7b3.zip
Merge pull request #12895 from nextcloud/bugfix/12890/log-openssl-errors
Read openssl error and log
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenProvider.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
index 9f596ac4568..fa9f11a65ab 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
@@ -295,6 +295,10 @@ class PublicKeyTokenProvider implements IProvider {
// Generate new key
$res = openssl_pkey_new($config);
+ if ($res === false) {
+ $this->logOpensslError();
+ }
+
openssl_pkey_export($res, $privateKey);
// 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));
+ }
}