@@ -121,15 +121,6 @@ public function getConnection() {
121121 )
122122 );
123123
124- // since we store the certificate bundles on the primary storage, we can't get the bundle while setting up the primary storage
125- if (!isset ($ this ->params ['primary_storage ' ])) {
126- /** @var ICertificateManager $certManager */
127- $ certManager = \OC ::$ server ->get (ICertificateManager::class);
128- $ certPath = $ certManager ->getAbsoluteBundlePath ();
129- } else {
130- $ certPath = \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt ' ;
131- }
132-
133124 $ options = [
134125 'version ' => isset ($ this ->params ['version ' ]) ? $ this ->params ['version ' ] : 'latest ' ,
135126 'credentials ' => $ provider ,
@@ -139,7 +130,7 @@ public function getConnection() {
139130 'signature_provider ' => \Aws \or_chain ([self ::class, 'legacySignatureProvider ' ], ClientResolver::_default_signature_provider ()),
140131 'csm ' => false ,
141132 'use_arn_region ' => false ,
142- 'http ' => ['verify ' => $ certPath ],
133+ 'http ' => ['verify ' => $ this -> getCertificateBundlePath () ],
143134 ];
144135 if ($ this ->getProxy ()) {
145136 $ options ['http ' ]['proxy ' ] = $ this ->getProxy ();
@@ -218,4 +209,15 @@ protected function paramCredentialProvider() : callable {
218209 return new RejectedPromise (new CredentialsException ($ msg ));
219210 };
220211 }
212+
213+ protected function getCertificateBundlePath (): string {
214+ // since we store the certificate bundles on the primary storage, we can't get the bundle while setting up the primary storage
215+ if (!isset ($ this ->params ['primary_storage ' ])) {
216+ /** @var ICertificateManager $certManager */
217+ $ certManager = \OC ::$ server ->get (ICertificateManager::class);
218+ return $ certManager ->getAbsoluteBundlePath ();
219+ } else {
220+ return \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt ' ;
221+ }
222+ }
221223}
0 commit comments