Unable to upload to s3 using pre_signed_url generated using IAM roles


I use the below code to generate a pre_signed_url to upload multiple files using a single url.

response = s3_client.generate_presigned_post(
            Conditions=[["starts-with", "$key", ""]],

I tested it out locally and it works but the url genrated in the ecs service that is deployed is throughing the following error requests.exceptions.SSLError: HTTPSConnectionPool(host='<bucket_name>.s3.amazonaws.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2423)')))

How to resole the issue i am facing , i looked into it and this github issue but we are not using ACL , can anyone help me with this

2 Answers
Accepted Answer

I have found the solution for the above issue,It was because of the another parameter x-amz-security-token that was not considered because of the response schema defined.

answered 3 months ago

The eror says an EOF (End of File) during an SSL handshake, might be related to the SSL/TLS communication when generating a pre-signed URL for S3 upload. Please check that you are using the correct S3 bucket name and AWS region when generating the pre-signed URL. Also check that the region and bucket specified in the code match the actual S3 bucket and region.

profile picture
answered 3 months ago
  • the bucket name is correct and i am not specifing the region name, is it required to specify the region name?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions