Support » Plugin: WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage » Configuring s3-accelerate.amazonaws.com produces double .s3

  • Resolved Graham Smith

    (@graham-smith)


    Hi,
    Firstly a quick thank you for this great plugin.

    Issue:
    When I add the region constant to wp-config, and refresh the admin Dashboard page for the plugin, I get an error because it has automatically inserted an extra .s3 into the url preventing it from working.

    AWS says to use this for the region endpoint:

    cdn-example-com.s3-accelerate.amazonaws.com
    and it works fine elsewhere

    I enter this in WP-config:

    // Bucket region (e.g. 'us-west-1' - leave blank for default region)
        'region' => 's3-accelerate',
    

    and the error is:

    There was an error attempting to check the permissions of the bucket cdn-invisionary-tech: Error executing "PutObject" on "https://cdn-example-com<strong>.s3</strong>.s3-accelerate.amazonaws.com/2021/06/as3cf-permission-check.txt"; AWS HTTP error: cURL error 60: SSL: no alternative certificate subject name matches target host name 'cdn-example-com<strong>.s3</strong>.s3-accelerate.amazonaws.com' (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

    Please can you advise the correct syntax to prevent the plugin from breaking the url by inserting the surplus .s3 between the bucket name and region?

    Many thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Delicious Brains Inc.

    (@deliciousbrains)

    I don’t think changing the region is the right approach as the region is mostly used for delivery operations, e.g. GetObject and when URL rewriting to raw S3 URLs.

    I believe you need to override the endpoint parameter for the SDK client.

    Try using the as3cf_aws_init_client_args filter to change the $args['endpoint'] to s3-accelerate.amazonaws.com.

    There’s an example on how to use the as3cf_aws_init_client_args filter in the WP Offload Media Tweaks plugin.

    https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront-tweaks/blob/beb2e0f1bba71be7b462a60209e5ff630a57437e/amazon-s3-and-cloudfront-tweaks.php#L228

    Please do not set the region as seen in the linked example though!

    And please do not use the ‘region’ key in the AS3CF_SETTINGS define unless you’re also using the bucket key, and only set it to the true bucket region, e.g. ‘eu-west-1’ or whatever is correct for your bucket.

    Ideally for S3 WP Offload Media should be allowed to discover the bucket’s region itself and use it as appropriate. It’s different for DigitalOcean Spaces where every operation must use a region and it’s therefore fine to specify the region as it’s always used.

    -IJ

    Thread Starter Graham Smith

    (@graham-smith)

    Thanks for the suggestions, I’ll take a further look at that.

    TBH, it would be wonderful and much easier for end users if the plugin supported S3 Acceleration out of the box, with a simple Enable/Disable toggle.

    Do you think this feature could be added?

    Thanks again.

    Plugin Author Delicious Brains Inc.

    (@deliciousbrains)

    @graham-smith I’ve added your vote for supporting transfer acceleration in our internal bug/feature tracker.

    -IJ

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.