2

I created a bucket similar to "mycdn.mysite.com" on Amazon-s3, as expected the files are available using that http://mycdn.mysite.com/files/foo.gif.

This works fine with http, I would like to somehow add a SSL certificate so that the files are served up via https, similar to https://mycdn.mysite.com/files/foo.gif.

Is it possible to add a certificate to Amazon-S3 that maps to a bucket name?

Kevin
  • 9,309
  • 12
  • 44
  • 51
  • This is now possible using CloudFront http://aws.amazon.com/cloudfront/custom-ssl-domains/ – jgv Jul 19 '13 at 19:56

3 Answers3

5

Nope this is not possible.

See this Amazon thread

And this one

jfs
  • 399,953
  • 195
  • 994
  • 1,670
willbt
  • 1,875
  • 13
  • 11
1

As previously stated, it's not directly possible, but you can set up Apache or nginx + SSL on a EC2 instance, CNAME your desired domain to that, and reverse-proxy to the (non-custom domain) S3 URL.

Mark Wang
  • 707
  • 6
  • 10
  • +1 as this solves the problem, but my purpose in using S3 in the first place is to serve static files offloaded from my server. For me, if I'm going to proxy I may as well host everything on my own server rather than S3 since storage space isn't the issue but rather bandwidth. – Benjamin Oman Dec 16 '13 at 08:11
-3

Just found a solution at - http://joonhachu.blogspot.com/2010/09/helpful-tip-for-amazon-s3-urls-for-ssl.html

img src="//s3.amazonaws.com/www.mysite.com/images/logo.gif"

Placing the "//" as the first part tells the browser to use whatever protocol its currently using. This works great as long as the browser is requesting HTTP or HTTPS which it always is when you have it online. Only time it isn't is when you are doing FILE protocol for local development. Small price to pay. Just do a search/replace big whoop.

The "s3.amazonaws.com" is the actual domain name of Amazon S3 web services and has an SSL key defined for it then placing your bucket and key after that point works great.

Sam Wilder
  • 869
  • 1
  • 9
  • 21
  • The question asked for a solution with a custom URL pointing to your Amazon Bucket - which is currently not possible as stated in @willbt's answer. This answer is not relevant to the question, other than to point out that reverting back from a custom URL will allow SSL access to the content without any certificate errors. – dazbradbury Mar 09 '12 at 20:23
  • -1, protocol-relative URLs are not a solution. – fnkr May 22 '13 at 06:39