I have read the amazon ec2 guide for setup https and finished several steps. But it still not working.
- sign a SSL certification, I use self-signed cert.
- use aws iam to upload the SSL cert to amazon server.
- In ec2 control platform, add port 80 and port 443 in the current security group's inbound
- create new load balancer, add http with port 80, the port 443 and https with the uploaded cert in the new load balancer, and assign current instance in the load balancer
Last, I have check the instance's security group and make sure it is right. I reboot the instance and the https does not work. The health check can pass in checking port 80. But it does not pass in checking port 443.
Do I miss any step?
Best Answer
I know this post is a year old, but I recently had similar issues and hope that someone might find this useful.
I see you are using a load balancer. You have to do the following:
Step 1
Make sure that port 443 is open on your EC2 instance and not being blocked by a firewall. You can run
on linux to check which ports are open. The output should look something like this:
Step 2
Make sure your security groups are setup as follows:
EC2 (INBOUND)
Load Balancer (Outbound)
Step 3
Make sure your EC2 instance is listening on port 443 (/etc/apache2/ports.conf) :
If you are using a virtual host, make sure it looks like this:
Step 4
Upload your certificate files in .pem format using the following commands:
Step 4
Create a listener on the Load Balancer which has the EC2 instance attached to it. The listener is for HTTPS and port 443. The listener will ask for a certificate and it will have the one you added from the aws cli already listed. If it is not listed, log out of the AWS console and log back in.
After, this, traffic via HTTPS will start flowing to your EC2 instance.
I had similar issues, and posted my question and answer here: HTTPS only works on localhost