Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not work as expected with AWS - SignatureDoesNotMatch #218

Closed
martynasp opened this issue Nov 29, 2017 · 1 comment
Closed

does not work as expected with AWS - SignatureDoesNotMatch #218

martynasp opened this issue Nov 29, 2017 · 1 comment

Comments

@martynasp
Copy link

If we have such uploader:

class FileUploader < CarrierWave::Uploader::Base
  include CarrierWaveDirect::Uploader
end

AWS responds with:

<?xml version="1.0" encoding="UTF-8"?>
<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>AKIAJ3XAFXRG7WWCP36Q</AWSAccessKeyId><StringToSign>...</StringToSignBytes><RequestId>89A2E7E7BD6135A9</RequestId><HostId>ClcOGqdr9Xx+r7lgzlmmCYsFKiMVu0G/kJhFan2+c4va+1zbx27EcGsbEztPg6qrO2EWBzYDJHQ=</HostId></Error>
@martynasp
Copy link
Author

Reverting back (from v.0.0.15) in Uploader module to this implementation:

def signature
      Base64.encode64(
        OpenSSL::HMAC.digest(
          OpenSSL::Digest.new('sha1'),
          aws_secret_access_key, policy
        )
      ).gsub("\n","")
    end

solves the issue

@p8 p8 closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants