diff options
author | Robin Appelman <robin@icewind.nl> | 2022-03-15 17:50:08 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2022-04-14 14:36:09 +0300 |
commit | 9342faccad3071e0fce22f18cacd5388a1a0f9f8 (patch) | |
tree | 6c3f4207b340f6b8f7b96744dce0a5cf546f1a6a | |
parent | a93dcbbcfcf3e093803cc7c5fa569d0857e28a7a (diff) |
don't try to get custom certs for s3 primary storagebackport/31574/stable23
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Files/ObjectStore/S3.php | 1 | ||||
-rw-r--r-- | lib/private/Files/ObjectStore/S3ConnectionTrait.php | 12 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/private/Files/ObjectStore/S3.php b/lib/private/Files/ObjectStore/S3.php index 074f3a1df91..6492145fb63 100644 --- a/lib/private/Files/ObjectStore/S3.php +++ b/lib/private/Files/ObjectStore/S3.php @@ -30,6 +30,7 @@ class S3 implements IObjectStore { use S3ObjectTrait; public function __construct($parameters) { + $parameters['primary_storage'] = true; $this->parseParams($parameters); } diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index 3fd04cd092c..03166ab1d7e 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -122,8 +122,14 @@ trait S3ConnectionTrait { ) ); - /** @var ICertificateManager $certManager */ - $certManager = \OC::$server->get(ICertificateManager::class); + // since we store the certificate bundles on the primary storage, we can't get the bundle while setting up the primary storage + if (!isset($this->params['primary_storage'])) { + /** @var ICertificateManager $certManager */ + $certManager = \OC::$server->get(ICertificateManager::class); + $certPath = $certManager->getAbsoluteBundlePath(); + } else { + $certPath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; + } $options = [ 'version' => isset($this->params['version']) ? $this->params['version'] : 'latest', @@ -134,7 +140,7 @@ trait S3ConnectionTrait { 'signature_provider' => \Aws\or_chain([self::class, 'legacySignatureProvider'], ClientResolver::_default_signature_provider()), 'csm' => false, 'use_arn_region' => false, - 'http' => ['verify' => $certManager->getAbsoluteBundlePath()], + 'http' => ['verify' => $certPath], ]; if ($this->getProxy()) { $options['http']['proxy'] = $this->getProxy(); |