summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-14 18:09:48 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2022-04-14 13:36:08 +0200
commiteb8989f40b8f7ece2751f470a3960ca4aba2b15d (patch)
treef604bea00a78be0a187b69101eb510d9c40440cb
parent04c8cf4cad37f32cffc127de3bf18fcb5f2f2d04 (diff)
downloadnextcloud-server-eb8989f40b8f7ece2751f470a3960ca4aba2b15d.tar.gz
nextcloud-server-eb8989f40b8f7ece2751f470a3960ca4aba2b15d.zip
use the nextcloud certificate bundle for s3
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Files/ObjectStore/S3ConnectionTrait.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
index c99ebdbcd5c..3fd04cd092c 100644
--- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php
+++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php
@@ -39,6 +39,7 @@ use Aws\S3\Exception\S3Exception;
use Aws\S3\S3Client;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\RejectedPromise;
+use OCP\ICertificateManager;
use OCP\ILogger;
trait S3ConnectionTrait {
@@ -121,6 +122,9 @@ trait S3ConnectionTrait {
)
);
+ /** @var ICertificateManager $certManager */
+ $certManager = \OC::$server->get(ICertificateManager::class);
+
$options = [
'version' => isset($this->params['version']) ? $this->params['version'] : 'latest',
'credentials' => $provider,
@@ -130,9 +134,10 @@ trait S3ConnectionTrait {
'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';