Unable to upload to s3 using pre_signed_url generated using IAM roles

0

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(
            bucket_name,
            "${filename}",
            Fields=fields,
            Conditions=[["starts-with", "$key", ""]],
            ExpiresIn=expiration,
        )

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 Risposte
0
Risposta accettata

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.

con risposta 6 mesi fa
0

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
con risposta 6 mesi fa
  • the bucket name is correct and i am not specifing the region name, is it required to specify the region name?

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande