protected function getSdk()
{
if (is_null($this->sdk)) {
$region = getenv('AWS_DEFAULT_REGION');
if (empty($region)) {
throw new \Exception('Environment variable AWS_DEFAULT_REGION not set.');
}
$parameters = ['version' => 'latest', 'region' => $region, 'retries' => 5, 'http' => ['connect_timeout' => 15, 'timeout' => 15]];
/** @todo upgrade or remove these lines as soon as AWS consistently uses TLS 1.2 */
if (defined('CURLOPT_SSLVERSION') && defined('CURL_SSLVERSION_TLSv1_0')) {
$parameters['http']['curl'][CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1_0;
}
$parameters['http_handler'] = $this->getHttpHandler();
$this->sdk = new \Aws\Sdk($parameters);
}
return $this->sdk;
}