Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Bind Port 443 causes issues with Certificates #3835

Closed
EntropySmoke opened this issue Nov 11, 2021 · 7 comments
Closed

Default Bind Port 443 causes issues with Certificates #3835

EntropySmoke opened this issue Nov 11, 2021 · 7 comments
Assignees
Milestone

Comments

@EntropySmoke
Copy link

Running the latest Edge build of AGH on Raspberry Pi 2 with Bullseye. New default AdGuardHome.yaml settings set Bind Port to 443 (HTTPS) by default, but it doesn't come with any certificates and connection is not encrypted. Attempts to add SSL certificates when using Bind Port 443 results in an error (about Port 443 being busy or something like that).
To input my local certificates, Bind Port must be set to 80, but once certificates are in place and re-direction to HTTPS is enabled, port 443 with encrypted connection becomes the default, while Bind Port 80 remains set in AdGuardHome.yaml.

Basically, I think it isn't a good idea to set default Bind Port to 443. It only creates issues and doesn't encrypt anything by default.

@t3dium
Copy link

t3dium commented Nov 12, 2021

Could just be because the 443 port is already being used up by another service on your device, in all my testing I've never ran into issues

@EntropySmoke
Copy link
Author

The only way TCP Port 443 works on AdGuard is if I set Bind Port to 80, use HTTPS certificate, and select automatic redirection.

If I simply bind TCP Port 443 in AdGuardHome.yaml, a connection can't be made.

@DavidOsipov
Copy link

I would like to just recommend using a reverse proxy like Nginx in from of Adguard home, which would listen to 443 port, strip encryption and forward requests to local Adguard home. Don't forget to set allow_unencrypted_doh: true in this configuration.

As for your problem, the 443 port is already occupied by some process and Adguard home can't bind to it. Do sudo lsof -i -P -n | grep LISTEN and find out the app, which is already binded to the 443 port.

@ainar-g
Copy link
Contributor

ainar-g commented Nov 15, 2021

New default AdGuardHome.yaml settings set Bind Port to 443 (HTTPS) by default

I don't believe that that's true. The initial port for the web interface is always 3000, and you set the actual port during the initial post-install setup process.

Attempts to add SSL certificates when using Bind Port 443 results in an error (about Port 443 being busy or something like that).

The only way TCP Port 443 works on AdGuard is if I set Bind Port to 80, use HTTPS certificate, and select automatic redirection.

This sounds like you're making AGH conflict with itself here. The bind_port setting is for the HTTP web interface, without the “S”. So, when you put the HTTPS port in there, the actual HTTPS server cannot start.

@ameshkov, do you think that we should just clarify that in the docs, or perhaps add some code to produce a better error message about the port conflict?

@ainar-g ainar-g added the waiting for data Waiting for users to provide more data. label Nov 15, 2021
@ameshkov
Copy link
Member

I'd prefer better config validation with a clear error message in this case.

@ainar-g ainar-g added enhancement P4: Low and removed waiting for data Waiting for users to provide more data. labels Nov 18, 2021
@ainar-g ainar-g added this to the v0.107.0 milestone Nov 18, 2021
@EugeneOne1 EugeneOne1 modified the milestones: v0.107.0, v0.107.1 Dec 15, 2021
adguard pushed a commit that referenced this issue Dec 16, 2021
Merge in DNS/adguard-home from 3835-imp-error-msg to master

Updates #3835.

Squashed commit of the following:

commit ba31cb6
Merge: 19c7dfc 4be69d3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 20:07:25 2021 +0300

    Merge branch 'master' into 3835-imp-error-msg

commit 19c7dfc
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 19:42:10 2021 +0300

    all: imp more

commit 5b9c6a3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 18:57:02 2021 +0300

    all: introduce aghhttp

commit 29caa17
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 14:23:53 2021 +0300

    all: imp more

commit 754c020
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Dec 15 20:53:41 2021 +0300

    all: imp code, log changes

commit ec712dd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Dec 15 18:40:54 2021 +0300

    home: check ports properly
@EugeneOne1
Copy link
Member

@EntropySmoke, hello again. We've just pushed the latest edge build. It contains some improvements on reporting the port binding errors. Could you please install it and check if those messages are clear enough?

@EugeneOne1
Copy link
Member

@EntropySmoke, I'll close the issue for now. Feel free to reopen it if the solution seems incomplete to you.

@ainar-g ainar-g modified the milestones: v0.107.1, v0.107.0 Dec 29, 2021
heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 3835-imp-error-msg to master

Updates AdguardTeam#3835.

Squashed commit of the following:

commit ba31cb6
Merge: 19c7dfc 4be69d3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 20:07:25 2021 +0300

    Merge branch 'master' into 3835-imp-error-msg

commit 19c7dfc
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 19:42:10 2021 +0300

    all: imp more

commit 5b9c6a3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 18:57:02 2021 +0300

    all: introduce aghhttp

commit 29caa17
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Dec 16 14:23:53 2021 +0300

    all: imp more

commit 754c020
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Dec 15 20:53:41 2021 +0300

    all: imp code, log changes

commit ec712dd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Dec 15 18:40:54 2021 +0300

    home: check ports properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants