-
Notifications
You must be signed in to change notification settings - Fork 41
Buckets
As of LWP 6.x, LWP::UserAgent will refuse the certificate (quite rightly) if the bucket name contains dots (as the virtual host will be a.b.s3.amazonaws.com, which doesn't match *.amazonaws.com). A possible solution is to use path-based access instead of virtual hosts (CPAN bug #66644), but see below.
There are a few caveats when accessing a bucket with the path-based approach, as opposed to the virtual host.
Amazon has this to say:
Amazon S3 supports virtual-hosted-style and path-style access in all Regions. The path-style syntax, however, requires that you use the region-specific endpoint when attempting to access a bucket. For example, if you have a bucket called mybucket that resides in the EU, you want to use path-style syntax, and the object is named puppy.jpg, the correct URI is http://s3-eu-west-1.amazonaws.com/mybucket/puppy.jpg. You will receive a “PermanentRedirect” error, an HTTP response code 301, and a message indicating what the correct URI is for your resource if you try to access a non US Standard bucket with path-style syntax using:
- http://s3.amazonaws.com
- A different Region endpoint than where the bucket resides, for example, http://s3-euwest-1.amazonaws.com and the bucket was created with the location constraint of Northern-California.
Amazon's note about this is here.