Download AWS S3. Invalid by policy: policy has expired.

I am using a Django server hosted in EC2 Singapore. I also use the S3 bucket to save files uploaded through the Django admin panel. To upload files, I use django-s3direct .

When I upload files using my local machine in East American time, this does not allow me to upload files that link to:

 <Message>Invalid according to Policy: Policy expired.</Message> 

I tried solutions from:
The exact recipient download of "Policy expired" sending a message to S3 for some here too: https://github.com/FineUploader/fine-uploader/issues/1387

When I check the boot time and UTC time, there is no difference. How to fix this error?

EDIT: It should be noted that the download works fine on the local host, but does not work on the server hosted on AWS EC2.

+5
source share
1 answer

Similar problems apply to inaccurate watches. It should be a client clock, not a server. I suggest writing code to check if client time is synchronized with a known and accurate time server. If the time is not synchronized, the user may be shown a friendly message to update the system clock. If the time is synchronized, you can continue to download.

+1
source

Source: https://habr.com/ru/post/1244547/


All Articles