Search code examples
amazon-s3cloud-foundryswisscomdev

Access to Swisscom S3 Service with AWS PHP SDK


I'm trying to connect a PHP Script running on my local machine to a Swisscom S3 Storage Space. The script runs well using Amazon's S3 Service.

I'm connecting like this:

static::$s3->client = \Aws\S3\S3Client::factory(array(
    'credentials' => array(
        'key'     => ['s3_aws_key'],
        'secret'  => ['s3_aws_secret'],
    ),
    'region'      => ['s3_aws_region'],
    'endpoint'    => ['s3_aws_endpoint'],
    'version'     => "2006-03-01",
    'signature'   => "v2"
));

I'm getting following exceptions:

On OSX 10.11.5, PHP 5.5.34 and libcurl/7.43.0

"type": "Aws\\S3\\Exception\\S3Exception",
"code": 0,
"message": "Error executing "PutObject" on "https://ds31s3.swisscom.com/***/***/***.jpg"; AWS HTTP error: cURL error 56: SSLRead() return error -9806 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"

On a Amazon EC2 Instance the exception is different:

"type": "Aws\\S3\\Exception\\S3Exception",
"code": 0,
"message": "Error executing "PutObject" on "https://ds31s3.swisscom.com/***/***/***.jpg"; AWS HTTP error: cURL error 56: TCP connection reset by peer (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)"  

Any hint in what direction I should look? As I said, running the script with Amazon works perfect.


Solution

  • Ok - found out:

    Downgrading the SDK from 3.1.X to 2.8.X solved the problem.