Skip to content

Add HTTPS support to web UI#783

Merged
rdmark merged 1 commit intoPiSCSI:developfrom
nucleogenic:webui-https-support
Aug 4, 2022
Merged

Add HTTPS support to web UI#783
rdmark merged 1 commit intoPiSCSI:developfrom
nucleogenic:webui-https-support

Conversation

@nucleogenic
Copy link
Copy Markdown
Member

@nucleogenic nucleogenic commented Aug 1, 2022

Enables HTTPS for Nginx and generates a self-signed certificate via easyinstall.sh.

The configuration is intended for browsers which support modern encryption. See https://caniuse.com/tls1-3 for specifics.

Users accessing the web UI from legacy devices/browsers can continue to use the HTTP service.

To my knowledge, a self-signed certificate is the simplest option for local network usage. There are a couple of approaches to getting a CA issued certificate, but setup is non-trivial for the average user. In any case, advanced users can install their own certificate in /etc/ssl/certs and the upgrade process will not overwrite them.

The configuration parameters are based on Mozilla's SSL Configuration Generator tool.

This PR addresses issue #489.

Raising as draft to allow for early feedback and additional testing.

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Aug 2, 2022

@nucleogenic This is neat, thanks for putting together this POC!

I haven't tested it yet, but you're saying that connections to http are still going to be accepted, right? One thing to test once I get around to it, is what Nginx will use by default when you don't specify the protocol. The usecase would be for vintage browsers, if you hit the IP address without the protocol, will you get the certificate error, or will it load the page over http.

@nucleogenic
Copy link
Copy Markdown
Member Author

In the revised Nginx config, the ssl keyword is only given for the listen directive on port 443, so connections via port 80 will remain unencrypted.

It is the browser's discretion on how to treat bare hosts/IPs entered in to the address bar, but we are not using any HTTP header or redirect techniques to coerce the browser to connect via HTTPS.

As far as my own (limited) testing goes, I am always served the HTTP version when accessing the RaSCSI via its IP address in the address bar.

Tested (no redirects, page loaded via HTTP):

  • Chrome 103
  • Safari 15.5
  • Firefox 103
  • IE5 Mac

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Aug 2, 2022

Thanks for explaining. I should have realized this by looking at the port number there.

@nucleogenic nucleogenic marked this pull request as ready for review August 3, 2022 03:22
@rdmark rdmark merged commit 4e622a9 into PiSCSI:develop Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants