RedirectSSL Concept #348

Closed
opened 2026-10-05 04:14:33 +02:00 by adam · 11 comments
Owner

I think that ZNC should have the ability to do what apache can do in terms of changing an HTTP request to HTTPS automatically. This would be awesome because then you wouldn't have to worry about adding HTTPS every time.

https://wiki.apache.org/httpd/RedirectSSL

I think that ZNC should have the ability to do what apache can do in terms of changing an HTTP request to HTTPS automatically. This would be awesome because then you wouldn't have to worry about adding HTTPS every time. https://wiki.apache.org/httpd/RedirectSSL <!-- github-sync-id:36619844 -->
adam closed this issue 2026-10-05 04:14:33 +02:00
Author
Owner

I currently run ZNC's webadmin behind nginx to get this (among other things). +1

I currently run ZNC's webadmin behind nginx to get this (among other things). +1 <!-- github-comment-id:47299353 -->
Author
Owner

How do I run it under a different web server?

How do I run it under a different web server? <!-- github-comment-id:47305949 -->
Author
Owner

@dylanhansch Look around for guides to setting up your preferred HTTP server (Apache, nginx, lighttpd, etc.) as a "reverse proxy". Note that ZNC really needs to be a nightly version at the moment, if you want webadmin to work behind a reverse proxy without random logouts. (It needs the X-Forwarded-For header support that was added since the last stable release.)

@dylanhansch Look around for guides to setting up your preferred HTTP server (Apache, nginx, lighttpd, etc.) as a "reverse proxy". Note that ZNC really needs to be a nightly version at the moment, if you want webadmin to work behind a reverse proxy without random logouts. (It needs the X-Forwarded-For header support that was added since the last stable release.) <!-- github-comment-id:47307071 -->
Author
Owner

But... this breaks concept of SSL?
As initial connect it not SSL, mitm can simply make it not redirect.
So users, instead of relying that mitm isn't presented, learn to use SSL from the start.

But... this breaks concept of SSL? As initial connect it not SSL, mitm can simply make it not redirect. So users, instead of relying that mitm isn't presented, learn to use SSL from the start. <!-- github-comment-id:47310697 -->
Author
Owner

A Strict-Transport-Security header could force the browser to replace the users 'http' with 'https'. I think this would produce results similar as wanted.

A Strict-Transport-Security header could force the browser to replace the users 'http' with 'https'. I think this would produce results similar as wanted. <!-- github-comment-id:47315135 -->
Author
Owner

Uhm. If I understand this correctly, RedirectSSL just means to redirect requests that go to http port 80 to https port 443. However, ZNC doesn't use the standard ports and there is no usable connection between any ssl and non-ssl port.

So if you want to force everything to be SSL, just don't enable a non-SSL port? You have to explicitely state the port number anyway since your ZNC likely doesn't listen on port 443. If it does, just use a tiny HTTP server that listens on port 80 and redirects requests to https and port 443...?

Do I misunderstand something or what is the actual issue here?

Uhm. If I understand this correctly, RedirectSSL just means to redirect requests that go to http port 80 to https port 443. However, ZNC doesn't use the standard ports and there is no usable connection between any ssl and non-ssl port. So if you want to force everything to be SSL, just don't enable a non-SSL port? You have to explicitely state the port number anyway since your ZNC likely doesn't listen on port 443. If it does, just use a tiny HTTP server that listens on port 80 and redirects requests to https and port 443...? Do I misunderstand something or what is the actual issue here? <!-- github-comment-id:47315751 -->
Author
Owner

In case he wants a redirect http://znc.in:1337 -> https://znc.in:1337
Port 80/443 is not needed here. HSTS and an HTTP reply if the browser erroneously talk to an HTTPS port with HTTP would do that

In case he wants a redirect http://znc.in -> https://znc.in:1337, this should be done with an external program, because http with omitted port defaults to port 80, and to get this behavior znc needs to bind to port 80 by some kind of default. And i dont think thats acceptable.

I suspect you are thinking of some kind like http://znc.in -> https://znc.in, which is a special case of the second one where znc is bound to 443 and therefore the port doesnt need to be specified.

In case he wants a redirect http://znc.in:1337 -> https://znc.in:1337 Port 80/443 is not needed here. HSTS and an HTTP reply if the browser erroneously talk to an HTTPS port with HTTP would do that In case he wants a redirect http://znc.in -> https://znc.in:1337, this should be done with an external program, because http with omitted port defaults to port 80, and to get this behavior znc needs to bind to port 80 by some kind of default. And i dont think thats acceptable. I suspect you are thinking of some kind like http://znc.in -> https://znc.in, which is a special case of the second one where znc is bound to 443 and therefore the port doesnt need to be specified. <!-- github-comment-id:47317697 -->
Author
Owner

In case he wants a redirect http://znc.in:1337 -> https://znc.in:1337
Port 80/443 is not needed here. HSTS and an HTTP reply if the browser erroneously talk to an HTTPS port with HTTP would do that

That's not what the RedirectSSL wiki page that was linked to explains/does.

> In case he wants a redirect http://znc.in:1337 -> https://znc.in:1337 > Port 80/443 is not needed here. HSTS and an HTTP reply if the browser erroneously talk to an HTTPS port with HTTP would do that That's not what the RedirectSSL wiki page that was linked to explains/does. <!-- github-comment-id:47319353 -->
Author
Owner

Is reimplementing RedirectSSL for ZNC the only solution to achive the wanted behavior?

Is reimplementing RedirectSSL for ZNC the only solution to achive the wanted behavior? <!-- github-comment-id:47321214 -->
Author
Owner

I was talking about having http://znc.in:1337 -> https://znc.in:1337. (I use port 7778, and that is SSL. I want to keep SSL. But it's annoying to have to manually type in https every time)

I was talking about having http://znc.in:1337 -> https://znc.in:1337. (I use port 7778, and that is SSL. I want to keep SSL. But it's annoying to have to manually type in https every time) <!-- github-comment-id:47344764 -->
Author
Owner

Duplicate of #320

Duplicate of #320 <!-- github-comment-id:65323951 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#348