mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 08:16:43 -04:00
use the nextcloud certificate bundle for s3
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
0ab5daf9df
commit
63dd72fda0
1 changed files with 6 additions and 1 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in a new issue