Hacker News new | ask | show | jobs
by turdnagel 2957 days ago
I've never tried to serve HTTPS locally without a proxy (ngrok etc.) or behind a load balancer, because I always end up serving the app with one or the other. And now there's Let's Encrypt. Why would you ever develop with HTTPS locally?
4 comments

> Why would you ever develop with HTTPS locally?

One good reason is to mimic the production environment, as there are an increasing number of browser features that depend on HTTPS (HSTS, cookie secure flags, new html5 APIs like the location api, etc). Though when I do use https locally I also typically use an nginx reverse proxy.

While lots of browsers trust localhost, I've found that there is a significant problem with developing some features. My current project for example uses HttpOnly,Secure cookies, which don't work on localhost.

So either I add an option to disable that (which I don't want to) or I simply reroute my traffic over a domain pointed at localhost I have a cert for.

My particular use case might have been kind of weird, but -- I was working on a HTTPS client and I wanted to hit a local HTTPS server for some of the tests in the client.
HTTP/2 apps need TLS