sasa1977 / site_encrypt

Integrated certification via Let's encrypt for Elixir-powered sites
MIT License
462 stars 33 forks source link

Incompatible with force_ssl? #42

Closed Hermanverschooten closed 2 years ago

Hermanverschooten commented 2 years ago

I noticed that when I have force_ssl: [hsts: true] in my config file, the certificate ordering does not succeed, instead I see a number of redirects for the let's encrypt urls to https.

Nov  6 00:01:27 bond bond[25335]: 00:01:27.388 [info] Plug.SSL is redirecting GET /.well-known/acme-challenge/wP03TwZ_eFcU42dOcqihQbAATB0tRGJ4UTXOwPRcuJo to https://tweedehandsbeursgrobbendonk.be with status 301

If I remove the force_ssl it works, but no redirection is happening.

Hermanverschooten commented 2 years ago

I solved it by using the plug proposed by Arjan in https://github.com/elixir-plug/plug/issues/815. This may come in handy for future reference.