0
votes

I have an EC2 instance on Amazon (AWS). The instance is behind a ELB (Elastic Load Balancer). I want to allow HTTPS connections to reach the EC2 instance.

Is it necessary to have the load balancer configured for HTTPS, ie, to check the certificates etc, or can this just be done traditionally within the EC2 instance and virtual host SSL configuration ?

The reason I'm asking is because I have allowed traffic via ELB -> EC2 for port 80 and 443, but only port 80 reaches the instance.

EDIT

Nmap scan report for localhost (127.0.0.1)
Host is up (0.00021s latency).
Not shown: 996 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
3306/tcp open  mysql

EDIT 2

Here is my other stack overflow questions explaining the bigger problem I have, hence why I opened this question. HTTPS only works on localhost

1
@Michael-sqlbot you should read my comment below stackoverflow.com/questions/35474862/… . I didnt want to take the credit for the answer when it was suggested by devd. So, just until the answer has been submitted, I added the solution in the first question. Once the answer has been submitted either by me or devd, I will remove the "solution part" - Janpan
You're right, I didn't see that the solution was suggested in comments. Not sure how I missed all that, it's pretty obvious now that you pointed it out. Thanks for the update. I'll remove my previous comment. - Michael - sqlbot
@Michael-sqlbot thanks. If devd does not respond in the next 4 hours, I will add the answer below and credit him/her. :) - Janpan

1 Answers

4
votes

Check whether any application is running on port 443.

Use this command to check:

nmap -sT -O localhost

EDIT

Add the certificate files on the server and then upload them to IAM using the command:

aws iam upload-server-certificate --server-certificate-name my-server-cert --certificate-body file://my-certificate.pem --private-key file://my-private-key.pem --certificate-chain file://my-certificate-chain.pem

For more info check this:

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html