2828 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2929 *
3030 */
31+
3132namespace OC \Files \ObjectStore ;
3233
3334use Aws \ClientResolver ;
@@ -143,7 +144,7 @@ public function getConnection() {
143144 if (!$ this ->connection ::isBucketDnsCompatible ($ this ->bucket )) {
144145 $ logger = \OC ::$ server ->get (LoggerInterface::class);
145146 $ logger ->debug ('Bucket " ' . $ this ->bucket . '" This bucket name is not dns compatible, it may contain invalid characters. ' ,
146- ['app ' => 'objectstore ' ]);
147+ ['app ' => 'objectstore ' ]);
147148 }
148149
149150 if ($ this ->params ['verify_bucket_exists ' ] && !$ this ->connection ->doesBucketExist ($ this ->bucket )) {
@@ -194,7 +195,7 @@ public static function legacySignatureProvider($version, $service, $region) {
194195 /**
195196 * This function creates a credential provider based on user parameter file
196197 */
197- protected function paramCredentialProvider () : callable {
198+ protected function paramCredentialProvider (): callable {
198199 return function () {
199200 $ key = empty ($ this ->params ['key ' ]) ? null : $ this ->params ['key ' ];
200201 $ secret = empty ($ this ->params ['secret ' ]) ? null : $ this ->params ['secret ' ];
@@ -210,14 +211,18 @@ protected function paramCredentialProvider() : callable {
210211 };
211212 }
212213
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 ();
214+ protected function getCertificateBundlePath (): ?string {
215+ if ((int )($ this ->params ['use_nextcloud_bundle ' ] ?? "0 " )) {
216+ // since we store the certificate bundles on the primary storage, we can't get the bundle while setting up the primary storage
217+ if (!isset ($ this ->params ['primary_storage ' ])) {
218+ /** @var ICertificateManager $certManager */
219+ $ certManager = \OC ::$ server ->get (ICertificateManager::class);
220+ return $ certManager ->getAbsoluteBundlePath ();
221+ } else {
222+ return \OC ::$ SERVERROOT . '/resources/config/ca-bundle.crt ' ;
223+ }
219224 } else {
220- return \ OC :: $ SERVERROOT . ' /resources/config/ca-bundle.crt ' ;
225+ return null ;
221226 }
222227 }
223228}
0 commit comments