Fix a wrong WebDAV Warning with self-signed-certs

Occuring in the admin interface
This commit is contained in:
kondou 2014-04-13 05:21:29 +02:00
parent 7fa0c3b7b7
commit d98ae4f9b2
2 changed files with 15 additions and 0 deletions

View file

@ -29,6 +29,8 @@ class OC_DAVClient extends \Sabre_DAV_Client {
protected $requestTimeout;
protected $verifyHost;
/**
* @brief Sets the request timeout or 0 to disable timeout.
* @param integer $timeout in seconds or 0 to disable
@ -37,10 +39,21 @@ class OC_DAVClient extends \Sabre_DAV_Client {
$this->requestTimeout = (int)$timeout;
}
/**
* @brief Sets the CURLOPT_SSL_VERIFYHOST setting
* @param integer $value value to set CURLOPT_SSL_VERIFYHOST to
*/
public function setVerifyHost($value) {
$this->verifyHost = $value;
}
protected function curlRequest($url, $settings) {
if ($this->requestTimeout > 0) {
$settings[CURLOPT_TIMEOUT] = $this->requestTimeout;
}
if (!is_null($this->verifyHost)) {
$settings[CURLOPT_SSL_VERIFYHOST] = $this->verifyHost;
}
return parent::curlRequest($url, $settings);
}
}

View file

@ -902,6 +902,8 @@ class OC_Util {
// for this self test we don't care if the ssl certificate is self signed and the peer cannot be verified.
$client->setVerifyPeer(false);
// also don't care if the host can't be verified
$client->setVerifyHost(0);
$return = true;
try {