Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
don't try to get custom certs for s3 primary storage
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and blizzz committed Apr 14, 2022
commit 9342faccad3071e0fce22f18cacd5388a1a0f9f8
1 change: 1 addition & 0 deletions lib/private/Files/ObjectStore/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class S3 implements IObjectStore {
use S3ObjectTrait;

public function __construct($parameters) {
$parameters['primary_storage'] = true;
$this->parseParams($parameters);
}

Expand Down
12 changes: 9 additions & 3 deletions lib/private/Files/ObjectStore/S3ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ public function getConnection() {
)
);

/** @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',
Expand All @@ -134,7 +140,7 @@ public function getConnection() {
'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();
Expand Down