]> source.dussan.org Git - nextcloud-server.git/commitdiff
send ca cert path to sabredav client
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 5 Jul 2012 09:28:32 +0000 (11:28 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 5 Jul 2012 09:28:32 +0000 (11:28 +0200)
3rdparty/Sabre/DAV/Client.php
apps/files_external/lib/webdav.php

index 23bd7c0539410c2863790775963354d8432768ad..d257c86da109ba3e9fdcbcf36b37228dad9fad33 100644 (file)
@@ -22,6 +22,7 @@ class Sabre_DAV_Client {
     protected $userName;
     protected $password;
     protected $proxy;
+    protected $capath;
 
     /**
      * Constructor
@@ -49,6 +50,11 @@ class Sabre_DAV_Client {
             'proxy'
         );
 
+        $this->capath = '';
+        if (isset($settings['capath'])) {
+               $this->capath = $settings['capath'];
+        }
+
         foreach($validSettings as $validSetting) {
             if (isset($settings[$validSetting])) {
                 $this->$validSetting = $settings[$validSetting];
@@ -249,9 +255,12 @@ class Sabre_DAV_Client {
             // Automatically follow redirects
             CURLOPT_FOLLOWLOCATION => true,
             CURLOPT_MAXREDIRS => 5,
+               CURLOPT_SSL_VERIFYPEER => true,
                //CURLOPT_SSL_VERIFYPEER        => false,
         );
 
+        if ($this->capath != '') $curlSettings[CURLOPT_CAPATH] = $this->capath;
+        
         switch ($method) {
             case 'PUT':
                 $curlSettings[CURLOPT_PUT] = true;
index dda8afe9f2ae499fdf73d37c504736b77804a430..097ff3c0162a9a725305f0576b30b40351375efe 100644 (file)
@@ -36,10 +36,13 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
                        $this->root.='/';
                }
                
+               $caview = \OCP\Files::getStorage('files_external');\r
+               $capath=\OCP\Config::getSystemValue('datadirectory').$caview->getAbsolutePath("");
                $settings = array(
                        'baseUri' => $this->createBaseUri(),
                        'userName' => $this->user,
                        'password' => $this->password,
+                       'capath' => $capath, 
                );
                $this->client = new Sabre_DAV_Client($settings);