aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-11-04 16:44:42 +0100
committerVincent Petry <pvince81@owncloud.com>2014-11-04 16:44:42 +0100
commit768f3979e048d5661fdf84fe3e8174f6d1147df3 (patch)
treed3c2c5898297554abd669476dda32c40a3c96b2a /apps
parent9323ba53b161fe56fcff5ea7bac14a731dd8db70 (diff)
downloadnextcloud-server-768f3979e048d5661fdf84fe3e8174f6d1147df3.tar.gz
nextcloud-server-768f3979e048d5661fdf84fe3e8174f6d1147df3.zip
Check for cert bundle existence before using it
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/external/storage.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 92d8f92b380..2da0022028f 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -198,12 +198,22 @@ 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 = null;
+ if ($status === 0) {
+ $errorMessage = curl_error($ch);
+ }
curl_close($ch);
+ if ($errorMessage) {
+ throw new \Exception($errorMessage);
+ }
switch ($status) {
case 401: