diff --git a/lib/private/davclient.php b/lib/private/davclient.php
index afa4e1103b495aed0f1a6ad794fd77092665081c..916dc11d17a286db8823b36ea52266eb562302cc 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 a744644b39c8bec2d3aafdfcbf4276745a69ca52..e20de308e875d7a24843752c489b6b76252d3f6a 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 {