aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-04-14 16:53:06 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-04-14 16:53:06 +0200
commitfe364656a494af0ce46c7cb84ed6303b5bae56d5 (patch)
tree32b1f76de97c8397846b988d51add40853f42b2f /lib
parent8df19c4379ceb1be43c1f9f7beb83cfed290e00d (diff)
parentd98ae4f9b25db6c3aa40ca254bc079ace710d0c0 (diff)
downloadnextcloud-server-fe364656a494af0ce46c7cb84ed6303b5bae56d5.tar.gz
nextcloud-server-fe364656a494af0ce46c7cb84ed6303b5bae56d5.zip
Merge pull request #8181 from owncloud/fix_wrong_webdav_warning
Fix a wrong WebDAV Warning with self-signed-certs
Diffstat (limited to 'lib')
-rw-r--r--lib/private/davclient.php13
-rwxr-xr-xlib/private/util.php2
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/davclient.php b/lib/private/davclient.php
index afa4e1103b4..916dc11d17a 100644
--- a/lib/private/davclient.php
+++ b/lib/private/davclient.php
@@ -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);
}
}
diff --git a/lib/private/util.php b/lib/private/util.php
index a744644b39c..e20de308e87 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -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 {