0

Migrating an AWS Service from React-Native Application to New Flutter Application.

I have come into trouble when it comes to getting the signed url to access images. I get the following error when trying to access them using the given url:

Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: application verification failure(handshake.cc:393)

when inspecting the URL outputs between flutter and react-native's sdk functions, I did notice that the host construction was reversed

s3.{region}.amazonaws.com/{bucketname} In react native {bucketname}.s3.{region}.amazonaws.com/ In Flutter

and tried a string operation to match these up as one quick way to solve this issue, resulting in a 403 error.

I don't have credentials to access the server, only all the setup details from the react-native application. So if some extra setup is needed in AWS to support the flutter's output, please let me know so I can communicate this directly to someone with credentials.

Thanks

  • To access S3 resources, Amazon STS needs to be used. Please have a look at this answer. https://stackoverflow.com/questions/45566453/amazon-bucket-policy-for-only-mobile-app-access/45568731#45568731 – DevPankajPatel Jun 06 '23 at 04:25

1 Answers1

0

I had the same issue and the following snippet from an amplify-flutter issue helped.

"Is your bucket with a domain name for example 'dev.aaa.com'?. bucket name with a domain name resolves bucket endpoint as dev.aaa.com.s3.ap-southeast-1.amazonaws.com which may cause Dart HTTP client to interpret the SSL certificate. Can you try to use a different bucket name". Complete discussion can be found here