Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a wrong WebDAV Warning with self-signed-certs #8181

Merged
merged 1 commit into from
Apr 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/private/davclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,10 +39,21 @@ public function setRequestTimeout($timeout) {
$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);
}
}
2 changes: 2 additions & 0 deletions lib/private/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ public static function isWebDAVWorking() {

// 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 {
Expand Down