Django-storages: Please use AWS4-HMAC-SHA256 error in [email protected]

Created on 7 Apr 2019  路  8Comments  路  Source: jschneier/django-storages

i am getting this error: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

I am using Django - 1.6.7, boto- 2.49.0

s3boto

Most helpful comment

Try using this values in settings.py:

if using boto3
AWS_S3_REGION_NAME = 'us-east-2' #change to your region
AWS_S3_SIGNATURE_VERSION = 's3v4'

if using boto
AWS_S3_HOST = 'us-east-2' #change to your region
S3_USE_SIGV4 = True

All 8 comments

@jschneier ?

Try using this values in settings.py:

if using boto3
AWS_S3_REGION_NAME = 'us-east-2' #change to your region
AWS_S3_SIGNATURE_VERSION = 's3v4'

if using boto
AWS_S3_HOST = 'us-east-2' #change to your region
S3_USE_SIGV4 = True

@jschneier This is still an issue in the default setup

For anyone else who hits this, the way I'm solving it is by removing the signature information from the url:

url_with_signature = model_instance.my_image_field.url # Results in AWS error
good_url = url_with_signature[:url_with_signature.index('?')]

For anyone else who hits this, the way I'm solving it is by removing the signature information from the url:

url_with_signature = model_instance.my_image_field.url # Results in AWS error
good_url = url_with_signature[:url_with_signature.index('?')]

A better way to not include signature in the url would be to use the AWS_QUERYSTRING_AUTH=False.

@Mexarm 's fix worked for me, but isn't there a fix for storages to prevent the error from even happening? Why close the issue?

I'm getting "The request signature we calculated does not match the signature you provided. Check your key and signing method." with Mexarm's boto3 solution.

Try using this values in settings.py:

if using boto3
AWS_S3_REGION_NAME = 'us-east-2' #change to your region
AWS_S3_SIGNATURE_VERSION = 's3v4'

if using boto
AWS_S3_HOST = 'us-east-2' #change to your region
S3_USE_SIGV4 = True

Thank you so much sir. Its worked.

Was this page helpful?
0 / 5 - 0 ratings