Closed (fixed)
Project:
AmazonS3
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Apr 2012 at 19:57 UTC
Updated:
28 Feb 2014 at 01:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Jorrit commentedHere is a patch for this feature.
Comment #2
tomfilepp commentedYou saved the day, thanks for this.
Comment #3
alfaguru commentedI think it would be better to use protocol relative URLs and avoid any requirement for an extra variable. We serve some pages over SSL and some not, so the approach in the above patch won't help us. Here's how this can be done, instead:
Comment #4
Jorrit commentedThat is also fine for me, thanks for improving on the patch.
Comment #5
tripper54 commentedI'm wondering if this should change the URL for https from
[bucket-name].s3.amazonaws.com
to
s3.amazonaws.com/[bucket-name]
Reason being if your bucket has dots in the name (eg files.mydomain.com) then amazon's *.s3.amazonaws.com certificate will not validate.
Or did you guys figure out another way around this problem?
Comment #6
geerlingguy commentedMarked #1741992: Support serving content over ssl as a duplicate.
Also, to tripper54/#5: Please see #1673888: Error with bucket names containing dots (.) over SSL.
Comment #7
geerlingguy commentedA patch-ified version of #3 attached.
Comment #8
geerlingguy commentedUpdating title, new patch. Looking into this further, I found that emails (specifically) and other non-web contexts require an explicit protocol definition (like
http://), and don't work with a simple//. Therefore, the attached patch detects whether the current page is being served over SSL or non-SSL, and defines the protocol appropriately.[Edit: Of course, I hadn't tested this patch before posting it... therefore I didn't realize it didn't work :P. Back to patch in comment above until a better way can be found.]
Comment #9
davidwbarratt commentedShouldn't you use $is_https instead of the $_SERVER super global?
Thanks!
Comment #10
davidwbarratt commentedI tested the most recent patch and it works! The only thing that probably should be changed is using the $is_https unless someone has a reason why using the global is a bad idea in this context?
Thanks!
Comment #11
bkonetzny commentedAttached patch uses the same logic Drupal core uses to set the current scheme (http or https) based on the $is_https global.
Comment #12
j.branson commentedThis builds on #11 to permanently add https support for pre-signed and torrent urls as it seems if it is a pre-signed url then it should be served via https no matter. Uses AWS get_object_url $opts array().
Comment #13
justafishI would prefer the solution in #3
I don't think presigned and torrented URLs should be hardcoded to use ssl
Comment #14
justafishplease review!
Comment #15
justafisheww, whitespace
Comment #16
justafishFix some warnings when using "*" as the path
Comment #17
justafishcommitted
https://github.com/justafish/amazons3/commit/04891ba2f9907523fc7b3098a17...