2

I work on a python3.6 app that uses flask and oauth2client.

I want to serve https instead of http in gcloud environment.

I tried using talisman-flask:

https://github.com/GoogleCloudPlatform/flask-talisman

However, when I ran their sample app locally I got this error in my browser:

This site can’t provide a secure connection
127.0.0.1 sent an invalid response.

It works fine for http, but can't apparently serve https.

Are there some Talisman configurations I need to change?
Or maybe a whole different solution altogheter?

EDIT:

I changed from debug=True to debug=False and now I get automatically redirected to https but the above error message is still there.

Arhire Ionut
  • 450
  • 1
  • 7
  • 16

2 Answers2

0

One rather generic approach which can work even with the standard environment local development server (which doesn't support HTTPS) would be to use a reverse proxy.

Such solutions are documented in Appengine - Local dev server with https

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
0

It's an old thread, but if you want to serve HTTPS (with or without Talisman) you need, at least, a valid certificate. Please, create one at Let's Encrypt and install in your web server, even if your site are in the web or in your local environment. If you want a good tutorial to help further, I recommend this from Miguel Grinberg, a big "Flask Guru" ;-) .

jrborba
  • 148
  • 1
  • 7