How to make the API work over HTTPS?

Good afternoon, friends. I have a website in Flask. Has a thermostat with an Internet connection. On this website the post request controller sends the data (temperature, etc.). The user can browse these data. When the site is running in HTTP it flows normally. When HTTPS is predictable request from the device does not pass. How to get around that? The thermostat is not to teach SSL.
March 19th 20 at 08:26
2 answers
March 19th 20 at 08:28
To break the project into two services? One you leave the controller with the HTTP, and the second to give the web a face for HTTPS?
March 19th 20 at 08:30
Well, there are several options. The easiest to render endpoint for the regulator on a separate http Routh (share-level web server) and then either duplicate the logic, or shift, or prokidyvaya to https simultaneously.

Also at the level of the web server, just disable the router https. Or even set up a proxy ... I'm still unable with a dozen versions to distribute
Honestly, I'm not very good at it. Now https is going through HAProxy.
Seen options using nginx + gunicorn.
And you mean at the level of the flask to make a route for http? How? In the application there are now no such. - earlene_Ha commented on March 19th 20 at 08:33
@earlene_Ha, in your case at the level of haproxy. And generally it is better to break this into 2 apps - tyreek66 commented on March 19th 20 at 08:36
@earlene_Ha, my nginx is also all correct, but the easiest and most obvious way is to sculpt two services. - bertha_Grimes commented on March 19th 20 at 08:39
@bertha_Grimes, @tyreek66, I've thought about it. But there will be reference to one database. How good is it? - earlene_Ha commented on March 19th 20 at 08:42
@earlene_Ha, and you have only the choice in the decision, and not safe. If a piece of iron is not able to safety we can about it once and forget it. Is it possible to break the circuit of preservation (you also sent the data to the database, and not Vice versa?) Using RabbitMQ, well, to put a hard validation of incoming data - tyreek66 commented on March 19th 20 at 08:45

Find more questions by tags FlaskHTTPSAPI