SSLException due uploading item for Amazon service

后端 未结 2 1908
借酒劲吻你
借酒劲吻你 2021-01-12 09:13

I upload my file to aws service from android. I configured it like this:

  AwsMetadata awsMetadata = resultData.getParcelable(Params.CommandMessage.EXTRA_MES         


        
相关标签:
2条回答
  • 2021-01-12 10:01

    There is a bug in the SDK where certain headers aren't signed. It will affect S3 in some regions, e.g. Frankfurt (eu-central-1) and China (cn-north-1), where sigv4 is required.

    AWS SDK for Android v2.2.2 is out http://aws.amazon.com/releasenotes/4067314458888112. This release addresses the sigv4 signing issue with S3. Check it out at http://aws.amazon.com/mobile/sdk/.

    0 讨论(0)
  • 2021-01-12 10:06

    I was having the same problem on Android when trying to upload directly from the device to S3, and it was related to time difference issues on the devices, as cutiko said. I was using latest SDK version available (2.3.3), so the mentioned SDK fix didn't really solve my problem.

    What I did to solve it:

    • Call an external service that returns the UTC time of an AWS server
    • Calculate the time difference between device time and server time, both in UTC
    • Use the s3Client.setTimeOffset() to set the time skew calculated before (in seconds)

    Hope it helps.

    0 讨论(0)
提交回复
热议问题