sst.dev icon indicating copy to clipboard operation
sst.dev copied to clipboard

Comments: Set up SSL

Open jayair opened this issue 9 years ago • 28 comments

Link to chapter - http://serverless-stack.com/chapters/setup-ssl.html

jayair avatar Apr 10 '17 01:04 jayair

2017-04-16_0928 I got this error, but maybe it's because I didn't actually purchase a domain. Instead, I used a domain I already own (at godaddy) and pointed to the AWS DNS servers. Find it here kikitty.com. Hoping I setup the www.kikitty.com bit properly. As of now, that's still not working.

geirman avatar Apr 16 '17 16:04 geirman

@geirman it looks like the two links are working now?

At which step did you see this error?

jayair avatar Apr 17 '17 17:04 jayair

yeah, the www is now working. SSL isn't. I got the error when I was expecting to receive this...

geirman avatar Apr 17 '17 19:04 geirman

Did you hit the limit on the number of certificates you can generate (http://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html)?

If not then you might need to contact AWS.

jayair avatar Apr 17 '17 21:04 jayair

I created an account to do your tutorial, so this was the very first certificate i tried to create. Unfortunately, tech support is "Unavailable under the Basic Support Plan". I'll try requesting a service limit increase :)

image

geirman avatar Apr 17 '17 21:04 geirman

Hmm that's really strange. It would be good if you could report back once they fix it for you. In case other folks run into similar issues.

jayair avatar Apr 18 '17 17:04 jayair

It's fixed. I requested a "Service Limit Increase" as shown above and received this yesterday (17 hours ago)...

I’m happy to inform you that we've approved and processed your Certificate Manager limit increase request for the US East (Northern Virginia) region. Please keep in mind that it can sometimes take up to 15 minutes for this to propagate and become available for use.

I waited 4 hours and tried again, but got no love. However, I tried again this morning and finally found success! Yay!

They unfortunately offered no explanation as to why I needed to make this request at all.

geirman avatar Apr 20 '17 12:04 geirman

Yeah their support can be a bit opaque at times.

jayair avatar Apr 20 '17 18:04 jayair

I encountered an issue wherein the certificate created isn't showing up - for those having the same one, make sure that the region you are currently in is US EAST (N.Virginia). Turns out I was in US WEST (Oregon) when I created the certificate and it doesn't seem to propagate right away.

ryanjcruz avatar May 24 '17 23:05 ryanjcruz

Hello, Thanks for the tutorial.

Looks interesting, but I want to avoid to configure services by clicking around a lot, IMHO things should be done with Infrasturcture as code.

So I intend to solve this if possible by adding the proper cloudformation configs to my serverless.yml. Dou you think that's possible - and easy or hard?

henning avatar Jun 16 '17 13:06 henning

@henning Some parts of the tutorial can be put into CloudFormation and serverless.yml but there are portions that are not supported by it. I know @nerdguru has been trying to figure that out as well.

And I agree, things should be automated but as a tutorial showing a bunch of CloudFormation templates isn't very instructive.

jayair avatar Jun 16 '17 17:06 jayair

Great tutorial first off! Thanks for the fine work on it.

Everything worked great until this step. After I setup the SSL and changed the Cloudfront Distributions' settings, I get "ERR_TOO_MANY_REDIRECTS" error and the app/page won't load.

I tried setting the CF settings back to what they were. Now I get same "too many redirects" error and it won't stop redirecting to https even though the settings are back to original. The distributions are marked as "deployed" and I did a invalidations of the caches on both the main and www distributions.

Ideas?

reverend333 avatar Jul 11 '17 18:07 reverend333

@mmiinnovations Thank you!

Some of this redirect stuff is a bit confusing. You just need to make sure the redirects are set up the right way. Also because of the CloudFront cache, the changes can take a little bit of time to take effect.

Basically, it looks like:

http://domain -> https://domain
http://www.domain -> https://domain
https://www.domain -> https://domain

To do this our main CF needs the Redirect HTTP to HTTPS but we leave our www CF as HTTP and HTTPS for the Viewer Protocol Policy.

Let me know if your settings look like this.

jayair avatar Jul 11 '17 18:07 jayair

Yes those are my settings.

I found what's causing the error but not how to fix it. When I set the S3 settings back to "Use this bucket to host a website" everything works fine. When it's set as the tutorial, I get "ERR_TOO_MANY_REDIRECTS" error. It's very consistent and repeatable.

Ideas?

reverend333 avatar Jul 12 '17 04:07 reverend333

@mmiinnovations You've got two S3 buckets right? One of them is hosting a site and the other is doing the redirect.

jayair avatar Jul 12 '17 16:07 jayair

No. I'm very confused if that's what's required.

reverend333 avatar Jul 12 '17 17:07 reverend333

@mmiinnovations Yeah we need a second S3 bucket to handle the redirect for our www version of the domain. It's a part of this chapter - http://serverless-stack.com/chapters/setup-www-domain-redirect.html.

Here is a reason why we do a redirect instead of just pointing both the www and apex domain to the same CloudFront and S3 bucket - https://github.com/AnomalyInnovations/serverless-stack-com/issues/66#issuecomment-312728802

jayair avatar Jul 12 '17 17:07 jayair

OK got it. After reading back through there I see it. I think that section of the tutorial needs just a bit more explanation. It's confusing and not explained well there.

Not complaining! You guys are great! This tutorial has been awesome. Thanks again for the work you put into it.

reverend333 avatar Jul 12 '17 17:07 reverend333

@mmiinnovations Yeah I'll add a bit more detail to it. Thanks for the feedback!

jayair avatar Jul 12 '17 17:07 jayair

@jayair two comments: 1.the certificate can be selected from the dropdown list of cloudfront, is only available to be created in us-east-1 region(N.Virginia), create from other region is not working. 2.for bare domain(example.com),suggest for the viewer policy to use redirect http to https, which is less confusing and better for the security purpose. because when we hitting www.example.com, will auto redirect to https://example.com, but when we hitting example.com, it will stay as is unless people specify https://example.com, which is not normal case.

thanks for your great tutorial : )

hutualive avatar Aug 03 '17 08:08 hutualive