mailhog / MailHog

Web and API based SMTP testing
MIT License
14.1k stars 1.07k forks source link

Would it be possible to make Mailhog's server work over https? #361

Open coredumperror opened 3 years ago

coredumperror commented 3 years ago

Everything is moving to https these days, and I've been finding myself frustrated with Mailhog because its webserver doesn't support SSL.

For instance, if I'm developing a piece of software locally that uses HSTS, it makes Chrome treat localhost as having to always be https, even if I type http:// manually. Which means if I go to http://localhost:8025 to get to MailHog, I end up always being redirected to https://localhost:8025, which the MailHog server can't respond on.

Would it be possible to make MailHog capable of responding over SSL with a self-signed cert? I can at least force Chrome past its error message about that. It's dramatically more annoying to force Chrome to erase is HSTS rule for localhost every time I need to visit the MailHog server, especially if I'm actively developing an HSTS app while also using MailHog.

m-noeck-l commented 3 years ago

I totally agree with @coredumperror

My workaround:

coredumperror commented 3 years ago

Thanks for the idea of using the hosts file! That'll let me bypass the HSTS issue entirely, even in Chrome.

ndench commented 3 years ago

You can also create a self signed certificate and use nginx as a reverse proxy in front of mailhog to get https.

tersmitten commented 2 years ago

Or haproxy. With auth enabled. That's how we run it -:)