0

I have a Flask API which has no database but just a json file that stores the data. At the moment I have put it on an EC2 and opened a port so someone can put in the IP address and port and have access to the API that way. The problem with this is that I get a mixed content error since the site it uses is HTTPS and the API is HTTP. I want to put the API behind HTTPS on a proper platform but I'm not sure where to start.

Is there a platform that I can host the API python file and the json file behind an HTTPS?

Eind997
  • 319
  • 1
  • 3
  • 9

2 Answers2

0

All of them? EC2 allows HTTPS (per @tawfikboujeh's comment). I don't actually know a hosting platform that would allow HTTP but not HTTPS.

There are some options in how you accomplish this:

  1. Use a self-signed certificate. This will give you HTTPS but all the modern browsers will give a nasty warning to all your visitors.
  2. Purchase a signed certification for you IP address from a CA. Just hope you don't have to change your IP address.
  3. Purchase a domain and use Let's Encrypt to generate a signed certificate for you.

Option 3 would be the most robust solution, but it does carry the cost of a domain (maybe $10/year).

noslenkwah
  • 1,702
  • 1
  • 17
  • 26
0

Google App Engine is perfect for this. SSL cert is free, and you would be in their free tier.

https://cloud.google.com/free

GAEfan
  • 11,244
  • 2
  • 17
  • 33
  • Thanks for this. Can you suggest a tutorial to follow for me? I keep getting error 502 Bad gateway – Eind997 Aug 01 '20 at 11:42