send ca cert path to sabredav client
This commit is contained in:
parent
9d00f4d2fb
commit
f86ecb3bf7
|
@ -22,6 +22,7 @@ class Sabre_DAV_Client {
|
||||||
protected $userName;
|
protected $userName;
|
||||||
protected $password;
|
protected $password;
|
||||||
protected $proxy;
|
protected $proxy;
|
||||||
|
protected $capath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -49,6 +50,11 @@ class Sabre_DAV_Client {
|
||||||
'proxy'
|
'proxy'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->capath = '';
|
||||||
|
if (isset($settings['capath'])) {
|
||||||
|
$this->capath = $settings['capath'];
|
||||||
|
}
|
||||||
|
|
||||||
foreach($validSettings as $validSetting) {
|
foreach($validSettings as $validSetting) {
|
||||||
if (isset($settings[$validSetting])) {
|
if (isset($settings[$validSetting])) {
|
||||||
$this->$validSetting = $settings[$validSetting];
|
$this->$validSetting = $settings[$validSetting];
|
||||||
|
@ -249,9 +255,12 @@ class Sabre_DAV_Client {
|
||||||
// Automatically follow redirects
|
// Automatically follow redirects
|
||||||
CURLOPT_FOLLOWLOCATION => true,
|
CURLOPT_FOLLOWLOCATION => true,
|
||||||
CURLOPT_MAXREDIRS => 5,
|
CURLOPT_MAXREDIRS => 5,
|
||||||
|
CURLOPT_SSL_VERIFYPEER => true,
|
||||||
//CURLOPT_SSL_VERIFYPEER => false,
|
//CURLOPT_SSL_VERIFYPEER => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->capath != '') $curlSettings[CURLOPT_CAPATH] = $this->capath;
|
||||||
|
|
||||||
switch ($method) {
|
switch ($method) {
|
||||||
case 'PUT':
|
case 'PUT':
|
||||||
$curlSettings[CURLOPT_PUT] = true;
|
$curlSettings[CURLOPT_PUT] = true;
|
||||||
|
|
|
@ -36,10 +36,13 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
|
||||||
$this->root.='/';
|
$this->root.='/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$caview = \OCP\Files::getStorage('files_external');
|
||||||
|
$capath=\OCP\Config::getSystemValue('datadirectory').$caview->getAbsolutePath("");
|
||||||
$settings = array(
|
$settings = array(
|
||||||
'baseUri' => $this->createBaseUri(),
|
'baseUri' => $this->createBaseUri(),
|
||||||
'userName' => $this->user,
|
'userName' => $this->user,
|
||||||
'password' => $this->password,
|
'password' => $this->password,
|
||||||
|
'capath' => $capath,
|
||||||
);
|
);
|
||||||
$this->client = new Sabre_DAV_Client($settings);
|
$this->client = new Sabre_DAV_Client($settings);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue