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
This commit is contained in:
parent
1710de8afb
commit
2a72eff9ee
|
@ -328,7 +328,7 @@ class Manager {
|
||||||
public function removeShare($mountPoint) {
|
public function removeShare($mountPoint) {
|
||||||
|
|
||||||
$mountPointObj = $this->mountManager->find($mountPoint);
|
$mountPointObj = $this->mountManager->find($mountPoint);
|
||||||
$id = $mountPointObj->getStorage()->getCache()->getId();
|
$id = $mountPointObj->getStorage()->getCache()->getId('');
|
||||||
|
|
||||||
$mountPoint = $this->stripPath($mountPoint);
|
$mountPoint = $this->stripPath($mountPoint);
|
||||||
$hash = md5($mountPoint);
|
$hash = md5($mountPoint);
|
||||||
|
|
|
@ -107,7 +107,11 @@ class DAV extends Common {
|
||||||
}
|
}
|
||||||
if ($this->secure === true) {
|
if ($this->secure === true) {
|
||||||
// inject mock for testing
|
// 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)) {
|
if (file_exists($certPath)) {
|
||||||
$this->certPath = $certPath;
|
$this->certPath = $certPath;
|
||||||
}
|
}
|
||||||
|
@ -812,6 +816,7 @@ class DAV extends Common {
|
||||||
* which might be temporary
|
* which might be temporary
|
||||||
*/
|
*/
|
||||||
private function convertException(Exception $e, $path = '') {
|
private function convertException(Exception $e, $path = '') {
|
||||||
|
\OC::$server->getLogger()->logException($e);
|
||||||
Util::writeLog('files_external', $e->getMessage(), Util::ERROR);
|
Util::writeLog('files_external', $e->getMessage(), Util::ERROR);
|
||||||
if ($e instanceof ClientHttpException) {
|
if ($e instanceof ClientHttpException) {
|
||||||
if ($e->getHttpStatus() === Http::STATUS_LOCKED) {
|
if ($e->getHttpStatus() === Http::STATUS_LOCKED) {
|
||||||
|
|
Loading…
Reference in New Issue