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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I am interested in the same thing. Is it possible to use the CDN with pre-signed requests?

Also affected here.

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.