Report this

What is the reason for this report?

Spaces CDN returns SignatureDoesNotMatch

Posted on November 27, 2018
fvg

By fvg

Hi! I’m successfully using DO Spaces with an Elixir libarary to build presigned urls:

signed_url =
  AWSAuth.sign_url(
    @access_key,
    @secret_key,
    "get",
    "https://mybucket.ams3.digitaloceanspaces.com/mybucket/0342cfce-f037-49c6-976f-97b2b8ec6f19.pdf",
    "ams3",
    "s3"
  )

This works fine, but I want to use the CDN to speed up the requests. I tried to add .cdn to the URL:

signed_url =
  AWSAuth.sign_url(
    # ...
    "https://mybucket.ams3.cdn.digitaloceanspaces.com/mybucket/0342cfce-f037-49c6-976f-97b2b8ec6f19.pdf",
    # ...
  )

However, this doesn’t work – I always get the following error:

<Error>
  <Code>SignatureDoesNotMatch</Code>
  <RequestId>tx000000000000049363e85-005bfd730a-b8ca18-ams3a</RequestId>
  <HostId>b8ca18-ams3a-ams3</HostId>
</Error>

I also tried signing the URL without .cdn and just accessing it with .cdn, but got the same error. What am I doing wrong?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.