4

I am working on a Facebook bot app. A requirements is to setup a webbook on my webserver to return a token, to validate my account.

I configured a micro instance (Ubuntu) and created a web server (Express.js, Node.js, Nginx (proxy_pass)).

I allowed port 443 in the inbound traffic of the security group on this server.

The problem is they require HTTPS enabled on the webhook endpoint.

How to make this happen with the normal AWS DNS they provide you, without needing to setup a domain and my own SSL cert?

so that this would work:

https://ec2-52-90-117-111.compute-1.amazonaws.com

9
  • Put Cloudfront in front of it.
    – ceejayoz
    Jun 22, 2016 at 17:26
  • Alternatively, get free SSL certificate with Let's Encrypt.
    – ceejayoz
    Jun 22, 2016 at 17:42
  • And I would configure my Nginx with that free SSL cert?
    – BausNauf
    Jun 22, 2016 at 17:48
  • 1
    Thanks! Just for clarification. I do need the SSL cert also if I am not intending to hook up my instance with a top level domain? and rather just use the AWS public DNS?
    – BausNauf
    Jun 22, 2016 at 17:55
  • 1
    SSL has absolutely nothing to with DNS.
    – ceejayoz
    Jun 22, 2016 at 18:27

3 Answers 3

0

You can continue using the domain name you from from AWS, but you can't avoid using externally issued SSL certs. Trusted SSL certificates, can be only issed by external entities, the one you make for yourself will not make it.

2
  • I understand. I am beginner in terms of HTTPs and SSL and my problem is that I thought the SSL cert needs to be attached to a domain that I own, but if I understand you correctly I can also use the domain name from AWS when setting up my SSL cert, right?
    – BausNauf
    Jun 27, 2016 at 9:53
  • if you don't want to have an own domain name, you can request a cert on the aws one
    – asdmin
    Jun 27, 2016 at 10:44
0

you can get a free ssl cert issued by startssl. it works well with EC2 and easy to setup.

https://www.startssl.com/Support?v=1

Cheers!!

3
  • thanks for your reply. To understand you correctly, that means I have to setup the ssl cert for my own domain right? I was hoping that I can enable HTTPS for the URL that Amazon give me (like this one ec2-52-90-117-111.compute-1.amazonaws.com ). Heroku supports Https by default and I thought AWS offers something similar.
    – BausNauf
    Jun 27, 2016 at 9:47
  • Sorry this setup is a bit confusing for me. I am new in this dev ops world :) To rephrase: Amazon provides some URL for my instance. My instance is a https server (nginx) that listens for port 80 and not 433 yet. I understand that I have to configure nginx for SSL, which requires a SLL cert right? I always thought I need to issue the SSL to some sort domain?
    – BausNauf
    Jun 27, 2016 at 9:50
  • @BausNauf Putting a domain name or a IP inside is up to you and depends on your use case, requirements, etc.
    – gxx
    Jun 27, 2016 at 9:54
0

I'd like to offer an alternative to StartSSL. You might want to try Certbot. It will take care of issuing the certificate, updating your Nginx config, and automatically renews your free certificates before they expire.

On a related note, you may want to register a domain or get an Elastic IP for your webhook. The reason is when your EC2 instance restarts for some reason, it will generate a new public IP and AWS hostname. If that happens, you'll need to update your webhook configuration on Facebook.

If your chatbot is still in the development process, you may want to check out ngrok. You can run it locally on your machine and it will accept HTTP & HTTPS requests. The best part is you don't have to pay for AWS hosting. Once your chatbot is ready, you can deploy it on AWS EC2 and get a certificate.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .