asuswrt-merlin icon indicating copy to clipboard operation
asuswrt-merlin copied to clipboard

webui: Add option to redirect to HTTPS

Open NHellFire opened this issue 7 years ago • 6 comments

Adds an option to force HTTPS for the webui.

NHellFire avatar Nov 09 '17 15:11 NHellFire

why not 301 status?

themiron avatar Dec 06 '17 23:12 themiron

It was already a JS redirect, I tried to change as little as possible.

NHellFire avatar Dec 07 '17 00:12 NHellFire

Just redirecting won't be enough, since the https port might not be 443. This will have to be taken into consideration.

Also, I would prefer a radio button rather than a checkbox on the webui, to be in-like with the rest of the UI.

RMerl avatar Dec 16 '17 05:12 RMerl

Wouldn't handling this in httpd.c as a 301 actually reduce the amount of changes required (as do_ssl wouldn't need to be moved for instance)? I was thinking of possibly handle_request() as a potential location.

RMerl avatar Dec 16 '17 05:12 RMerl

Hrm, I thought I included the port.. maybe I committed the wrong version.

I can change it to a radio and look at doing it in handle_request() as a 302 (301 is a permanent redirect so if SSL is disabled or port is changed, browser cache will need clearing as it won't recheck it).

NHellFire avatar Dec 16 '17 11:12 NHellFire

302 might possibly be better indeed in this case, although when I configure a customer's website to redirect http to https through mod_rewrite, I always used a 301, as 302 seem to imply that it's expected to eventually no longer redirect.

RMerl avatar Dec 16 '17 18:12 RMerl