Reputation: 57
I'm attempting to test OAuth, logins, so I need HTTPS connection. I am using flask, so to achieve this I self-signed a certificate and am using the following function to run flask:
if __name__ == '__main__':
app.run(debug=True, ssl_context=('cert.pem', 'key.pem'), port = 5000)
Whenever I try to connect to localhost:5000, I get the following error message from chrome:
This site can’t be reached. The connection was reset.
No indication from flask that any connection was made. (No files were served.) The app works perfectly (besides OAuth) when the ssl_context parameter is not in app.run, but it is served over HTTP. I have checked the option on chrome experimental to allow unsecure certificates on localhost.
I have used the local server over HTTPS one time, and it worked fine - after I rebooted the server, I have not been able to recreate the success. I have attempted switching the port, switching browsers, and switching to a new certificate.
Upvotes: 1
Views: 1728
Reputation: 57
Minutes after posting, I realized HTTPS is not implied, and therefore when accessing localhost:5000, it is paramount that I type https://localhost:5000, with the https included.
I am going to leave this up just in case someone runs into the same issue.
Upvotes: 4