Forums

Flask-SSLify

Hi

I installed the Flask-SSLify to redirect all incoming requests to HTTPS. Then I uninstalled the Flask-SSLify package to return back to normal HTTP. Now when I try to run my flask app I got this error message ("Your connection is not private"), and I still have the HTTPS with the URL of my flask app (https://www.ultimategroup.app/).

Any help would be appreciated.

I think there are two problems:

  • Your HTTPS site is showing up with an error ERR_CERT_COMMON_NAME_INVALID, which means that you don't have a certificate installed for it. You can get a free one from Let's Encrypt by following these instructions.
  • When you visit the HTTP site, you're not being redirected to the HTTPS site despite having added Flask-SSLify. Of course, that's probably a good thing while the HTTPS site is showing a security error :-) But once you've fixed that problem, you'll want it to work, of course. I suspect that the problem is that Flask-SSLify doesn't do the redirect if you have debug set to True. I'm not sure why it does that, and it's not super-well-documented, but if you set debug to False then it should work fine.

Hi

Thank you for your response - as said before I removed Flask-SSLify package from my flask app. Now, I just want to return my app back to normal http instead of https.

Any chance to know how to solve this problem?

Ah, sorry, I misunderstood. Your website will always run on two URLs, one secure and one non-secure. If you visit http://www.ultimategroup.app/ then you'll get the non-secure one, and if you visit https://www.ultimategroup.app/ then you'll get the secure one. The latter will always give a security error until you install a certificate.

Hi Giles,

Thank you for your help.

How to get the first URL to work (http://www.ultimategroup.app/).

It looks like it works fine to me -- when I go there I get a login page. Are you getting somehow redirected to the HTTPS page? If so, perhaps your browser has cached some kind of "always use HTTPS" thing -- try clearing your browser cache.