0

I am trying to debug a situation with my elastic beanstalk enviornment where my certificate from certificate manager is successfully being recognized by my eb environment name and throwing an error, as it should, since my certificate is for my domain and not elasticbeanstalk.com, but when I try to access my site at beta.mysite.com I notice that it is still using http and not https. As a result I am trying to determine if this is an issue with my CNAME records, my expressjs setup or something with my load balancer. Here is my current setup:

SSL ID: .*mysite.com

  • Status: Issued
  • In Use: Yes

Load Balancer:

  • Listener Port: 80
  • Protocol: HTTP
  • Secure Listener Port: 443
  • Protocol: HTTPS
  • Cross-zone load balancing: Unchecked
  • SSL certificate ID: .*mysite.com

  • Rest of options set by default

CNAME:

  • Name: beta.mysite.com
  • Alias: No
  • TTL: 300 seconds
  • Value: beta-app.us-east-1.elasticbeanstalk.com
  • Routing Policy: Simple

ExpressJS:

  • I figured that all of this process should exist on the server instance and not in the back-end code so I have not added any modules or options for using https.
cphill
  • 5,596
  • 16
  • 89
  • 182

1 Answers1

1

but when I try to access my site at beta.mysite.com I notice that it is still using http and not https.

That's simply because you went to http://beta.mysite.com instead of https://beta.mysite.com Notice how you can go to both http://stackoverflow.com and https://stackoverflow.com, that's how your application is configured right now.

Installing an SSL certificate doesn't automatically cause HTTP requests on port 80 to be redirected to HTTPS requests on port 443. You would need to add some configuration options in your Elastic Beanstalk's Nginx server, or in your ExpressJS server code, to detect requests that are HTTP, and redirect them to HTTPS, like this.

Community
  • 1
  • 1
Mark B
  • 183,023
  • 24
  • 297
  • 295
  • thank you so much for clearing up my confusion. This is my first venture into using SSL and I plan on redirecting all traffic to HTTPS due to authenticity on my application. Would you recommend one method of redirecting over the other? (Nginx vs ExpressJS) – cphill Sep 08 '16 at 16:53
  • I would usually recommend using Nginx for this, it might be easier in the ExpressJS code on Elastic Beanstalk though. – Mark B Sep 08 '16 at 17:07