S3 presigned URLs not working with Safari 15/iOS 15

0

We are migrating a project to PHP SDK V3 from V2. During the testing, we found the images using presigned URLs generated by PHP SDK V3 cannot successfully work with Safari 15/iOS 15. It is easy to test this problem by constructing a simple html file like this: <img src="presigned S3 URL">

Then open the html file in Safari, the image will not be successfully downloaded (403 error) unless you turn off the "Hide IP address" option in Safari 15's preference settings. In Safari 15/iOS 15, the "Hide IP address" is turned on by default, so it's not an option to ask end-users to turn it off. Nevertheless, if you generate the presigned S3 URL by PHP SDK v2, the presigned URLs will work well in Safari 15. We think the V4 signature algorithm used in PHP SDK v3 includes more header checking which failed in Safari 15. Please help us to solve this problem. Thanks a lot.

已提問 2 年前檢視次數 228 次
1 個回答
0
已接受的答案

We found the problem. It is due to that Safari will use apple's machine to download the image file when the "Hide IP address" option is turned on. That machine's IP address is not in the allowed range of the IAM group user which generate the presigned url. Although we are still not sure why v2 signature used by PHP SDK v2 is OK on this situation.

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南