summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-11-04 20:05:49 +0100
committerVincent Petry <pvince81@owncloud.com>2014-11-04 20:05:49 +0100
commit140faf2c300bd15ea89785742445e1282ea01671 (patch)
treef0df588244fa5c16b922fead53628cf7ac1b6d5f
parent9323ba53b161fe56fcff5ea7bac14a731dd8db70 (diff)
parentee6d8c9d589c95a12fab5d1a1bcfdd3c6ad8f4c0 (diff)
downloadnextcloud-server-140faf2c300bd15ea89785742445e1282ea01671.tar.gz
nextcloud-server-140faf2c300bd15ea89785742445e1282ea01671.zip
Merge pull request #11949 from owncloud/s2s-fixcertcheckwhennocertfile
Check for cert bundle existence before using it
-rw-r--r--apps/files_sharing/lib/external/storage.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 92d8f92b380..3f1d631a35f 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -198,12 +198,19 @@ class Storage extends DAV implements ISharedStorage {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
- curl_setopt($ch, CURLOPT_CAINFO, $this->certificateManager->getCertificateBundle());
+ $path = $this->certificateManager->getCertificateBundle();
+ if (is_readable($path)) {
+ curl_setopt($ch, CURLOPT_CAINFO, $path);
+ }
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ $errorMessage = curl_error($ch);
curl_close($ch);
+ if (!empty($errorMessage)) {
+ throw new \Exception($errorMessage);
+ }
switch ($status) {
case 401: