From 2a72eff9ee5c337f75e8d0434cd93aada6a38eec Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 27 Jun 2016 22:26:43 +0200 Subject: Fix getting the certificate bundle for dav external storage (#25274) * Fix getting the certificate bundle for dav external storages * Log the original exception in dav external storage --- lib/private/Files/Storage/DAV.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index c8088a41c47..7eb6aa199b1 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -107,7 +107,11 @@ class DAV extends Common { } if ($this->secure === true) { // inject mock for testing - $certPath = \OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt'; + $certManager = \OC::$server->getCertificateManager(); + if (is_null($certManager)) { //no user + $certManager = \OC::$server->getCertificateManager(null); + } + $certPath = $certManager->getAbsoluteBundlePath(); if (file_exists($certPath)) { $this->certPath = $certPath; } @@ -812,6 +816,7 @@ class DAV extends Common { * which might be temporary */ private function convertException(Exception $e, $path = '') { + \OC::$server->getLogger()->logException($e); Util::writeLog('files_external', $e->getMessage(), Util::ERROR); if ($e instanceof ClientHttpException) { if ($e->getHttpStatus() === Http::STATUS_LOCKED) { -- cgit v1.2.3