[SOLVED] ERR_SSL_PROTOCOL_ERROR on https://localhost:3000
I was trying to enforce HTTPS on my deployed website on Heroku. https://help.heroku.com/J2R1S4T8/can-heroku-force-an-application-to-use-ssl-tls After setting up npm module express-sslify, I succeeded in forcing to use HTTPS on my deployed site on Heroku with 301 redirection; https://www.npmjs.com/package/express-sslify but then when I test the app in my computer with node server.js it forces my localhost to redirect to https://localhost:3000 and Chrome shows the above error ERR_SSL_PROTOCOL_ERROR I have edited the middleware line to if (app.get("env") === "production") { app.use(enforce.HTTPS({ trustProtoHeader: true })); } following issue #22: https://github.com/florianheinemann/express-sslify/issues/22 but it kinds of remember it I have queryed in chrome://net-internals/#hsts and localhost is not in the list. Both of above steps does not solve the problem. Can't develop any app now 🤷♂️ What should I do? Use OpenSSL to self-sign a SSL cert? But how to use that for development only?