Skip to content
Merged
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
Next Next commit
use the nextcloud certificate bundle for s3
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and blizzz committed Apr 14, 2022
commit eb8989f40b8f7ece2751f470a3960ca4aba2b15d
7 changes: 6 additions & 1 deletion lib/private/Files/ObjectStore/S3ConnectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Aws\S3\S3Client;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\RejectedPromise;
use OCP\ICertificateManager;
use OCP\ILogger;

trait S3ConnectionTrait {
Expand Down Expand Up @@ -121,6 +122,9 @@ public function getConnection() {
)
);

/** @var ICertificateManager $certManager */
$certManager = \OC::$server->get(ICertificateManager::class);

$options = [
'version' => isset($this->params['version']) ? $this->params['version'] : 'latest',
'credentials' => $provider,
Expand All @@ -130,9 +134,10 @@ 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()],
];
if ($this->getProxy()) {
$options['http'] = [ 'proxy' => $this->getProxy() ];
$options['http']['proxy'] = $this->getProxy();
}
if (isset($this->params['legacy_auth']) && $this->params['legacy_auth']) {
$options['signature_version'] = 'v2';
Expand Down