大网数据广告活动
服务器运维问答

Do I need an SSL certificate on my EC2 server even when I have a load balancer?

· 52CE 我爱测

Starting to setup a Load Balanser in AWS, I ran into some additional questions. Basically I have a web site/app deployed in an EC2 instance. I'd like to make it secure by using an AWS generated cert via Certificate Manager. As I …

问题原文

原帖链接 · jola · CC BY-SA 4.0

Starting to setup a Load Balanser in AWS, I ran into some additional questions.

Basically I have a web site/app deployed in an EC2 instance. I'd like to make it secure by using an AWS generated cert via Certificate Manager. As I already have understood EC2 cannot itself manage this and one easy way to enable it would be to deploy a Load Balancer in front of EC2 which secures the client communication with my ACM certificate.

Maybe easy, but not for me...

QUESTION 1: Since I don't want to deploy multiple EC2 instances I need to deploy a "Classic Load Balancer" instead of an "Application Load Balancer" (since the latter requires at least 2 EC2 instances). Is this correct?

QUESTION 2: I want the visitors of the web site to get the "secure" indication in their browsers. I assume this means I need to use HTTPS all the the way client <-> Load Balancer <-> EC2, and cannot terminate the SSL/HTTPS in the LB. Is this a correct assumption?

QUESTION 3: If the previous assumption is correct, should I then use another certificate for the HTTPS communication between the Load Balancer and EC2? Afaiu the one I have in ACM cannot be used. Would the correct way be to generate a new, private certificate in ACM to use for this?

QUESTION 4: If so, would a private certificate still give the end-user the benefit of a fully signed certificate, or would it be seen as a self-signed cert (which I don't want)?

QUESTION 5: Maybe totally wrong (and showing how much I really know about certifiates ;-) but since I already have another ssh-certificate (from my IAM user, which I use to ssh to the ec2 instance) on the ec2 instance, could this one be used in the Load Balancer <-> EC2 step?

Ok, that's all I think, at least for now... Thanks!

UPDATE Thanks to the helpful answers I got this to work, and turns out easier than I thought when writing the original question. I just launched an "Application Load Balancer" with http an https listeners with my ACM cert, keeping all the default options. Adding a CNAME entry in my external DNS to my loadbalancer's DNS name and the SSL works just fine.

社区高分解答

原帖链接 · Tim · CC BY-SA 4.0

You can use a Let's Encrypt certificate, or any other certificate, directly on your EC2 instance. You can't use an ACM certificate though. This would avoid the need for a load balancer. I have a short tutorial about that here.

To answer your questions

  1. I don't think an ALB requires multiple EC2 instances, one should be fine.

  2. If set up correctly you can terminate HTTPS on the load balancer and the browser will still show the connection as secure. This is generally appropriate for most workloads as the AWS internal network is considered trust and secure.

  3. You could do end to end encryption, using any other type of certificate.

  4. You'd have to check if self signed certificates work with ALB. Given Let's Encrypt is free and easy I don't see why you'd bother.

  5. No, they're different types of certificate.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-10-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。