taylorfinnell / awscr-signer

AWS request signing in Crystal
MIT License
22 stars 15 forks source link

examples/request_signing_v4.cr works on Mac OS X but not on Linux #60

Closed weirdbricks closed 3 years ago

weirdbricks commented 3 years ago

Hi,

First of all thank you for the great work on the signer.

It works flawlessly on Mac OS X but I cannot get it to work on Linux. I have tried it in a CentOS 8 container and a the official Crystal Lang/alpine container with no luck.

Details:

Mac OS X:

crystal version -v
Crystal 1.0.0 (2021-03-22)

LLVM: 9.0.1
Default target: x86_64-apple-macosx
shards list
Shards installed:
  * awscr-signer (0.8.2)

Linux:

I'm using the Alpine Linux Docker container:

crystallang/crystal:latest-alpine
crystal --version
Crystal 1.0.0 [dd40a2442] (2021-03-22)

LLVM: 10.0.0
Default target: x86_64-unknown-linux-musl
shards list
Shards installed:
  * awscr-signer (0.8.2)

The error on Linux is:

<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId><----REDACTED----></AWSAccessKeyId><StringToSign>AWS4-HMAC-SHA256
20210514T222850Z
20210514/us-west-2/s3/aws4_request

I use the exact same credentials in both cases. Any thoughts on what may be going wrong?

Thanks!

taylorfinnell commented 3 years ago

I’m guessing here but maybe a region issue or time/clock issue? I’ve never used this in docker but I’ve used it on Heroku’s Linux distro with no issue. Sorry this isn’t so helpful

weirdbricks commented 3 years ago

hi @taylorfinnell that's fair, I didn't try it in an actual VM/bare metal instance. I'll test tomorrow and report back. Thanks again!

weirdbricks commented 3 years ago

hi @taylorfinnell , indeed I just tested on an AWS Amazon Linux instance and worked right away. Thanks again, I'll see if I can figure what's the problem with the Docker containers.