How to use http options on S3Client to set cert

Set to an array of HTTP options that are applied to HTTP requests and transfers created by the SDK.

The SDK supports the following configuration options:

cert

Type

string|array

Specify the PEM formatted client side certificate.

  • Set as a string for the path to only the certificate file.
use Aws\S3\S3Client;
 $client = new S3Client([
     'region'  => 'us-west-2',
     'version' => 'latest',
     'http'    => ['cert' => '/path/to/cert.pem']
 ]);

Set as an array containing the path and password.

use Aws\S3\S3Client;
 $client = new S3Client([
     'region'  => 'us-west-2',
     'version' => 'latest',
     'http'    => [
         'cert' => ['/path/to/cert.pem', 'password']
     ]
 ]);

Leave a Comment

Your email address will not be published. Required fields are marked *