Skip to content

Commit b400139

Browse files
icewind1991DeepDiver1975
authored andcommitted
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
1 parent 86a0e64 commit b400139

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/files_sharing/lib/External/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function setMountPoint($source, $target) {
328328
public function removeShare($mountPoint) {
329329

330330
$mountPointObj = $this->mountManager->find($mountPoint);
331-
$id = $mountPointObj->getStorage()->getCache()->getId();
331+
$id = $mountPointObj->getStorage()->getCache()->getId('');
332332

333333
$mountPoint = $this->stripPath($mountPoint);
334334
$hash = md5($mountPoint);

lib/private/Files/Storage/DAV.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ public function __construct($params) {
107107
}
108108
if ($this->secure === true) {
109109
// inject mock for testing
110-
$certPath = \OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt';
110+
$certManager = \OC::$server->getCertificateManager();
111+
if (is_null($certManager)) { //no user
112+
$certManager = \OC::$server->getCertificateManager(null);
113+
}
114+
$certPath = $certManager->getAbsoluteBundlePath();
111115
if (file_exists($certPath)) {
112116
$this->certPath = $certPath;
113117
}
@@ -812,6 +816,7 @@ public function hasUpdated($path, $time) {
812816
* which might be temporary
813817
*/
814818
private function convertException(Exception $e, $path = '') {
819+
\OC::$server->getLogger()->logException($e);
815820
Util::writeLog('files_external', $e->getMessage(), Util::ERROR);
816821
if ($e instanceof ClientHttpException) {
817822
if ($e->getHttpStatus() === Http::STATUS_LOCKED) {

0 commit comments

Comments
 (0)