AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
23.56k stars 1.73k forks source link

Error when switching to the "Encryption Settings" page #6909

Closed fizsef closed 2 months ago

fizsef commented 2 months ago

Prerequisites

Platform (OS and CPU architecture)

Linux, ARM64

Installation

GitHub releases or script from README

Setup

On a router, DHCP is handled by the router

AdGuard Home version

107.48

Action

In the menu, select Settings-Encryption settings

Expected result

without error

Actual result

An error appears - "Error: control/tls/validate | port 443 is not available, cannot enable HTTPS on it | 400"

Additional information and/or screenshots

1

renatoyamane commented 2 months ago

Probably because you are using port 443 for another service?

fizsef commented 2 months ago

Probably because you are using port 443 for another service?

No, I'm not busy, I don't even know how to occupy it.

ghost commented 2 months ago

Hi @fizsef, it seems that something on your device may be using that port.

What do you get for the following command? sudo netstat -tunlp | grep :443

fizsef commented 2 months ago

What do you get for the following command? sudo netstat -tunlp | grep :443

1

ghost commented 2 months ago

@fizsef it seems you have the OpenWrt LuCI interface running on port 443.

To change the port for AdGuard Home on OpenWrt, you can follow these steps:

  1. Access your OpenWrt router via SSH or through the LuCI web interface.
  2. Edit the AdGuard Home configuration file. This file is typically located at /etc/AdGuardHome.yaml or /opt/AdGuardHome/AdGuardHome.yaml, depending on how AdGuard Home was installed.
  3. Locate the section in the configuration file that specifies the port settings. It will look something like this:
  4. Change the https port value from 443 to a different port number that is not in use by another service. For example, you could use 8080 or 5353.
  5. Save the changes to the configuration file.
  6. Restart AdGuard Home to apply the new settings. You can do this by running the command /etc/init.d/AdGuardHome restart or by rebooting your router.

Make sure the new port you choose does not conflict with other services and is not blocked by your firewall settings.

If you’re using LuCI, you may also need to adjust the firewall settings to allow traffic on the new port. Navigate to Network → Firewall → Traffic Rules and add a rule for the new port.

fizsef commented 2 months ago

@fizsefкажется, у вас интерфейс OpenWrt LuCI работает на порту 443.

Чтобы изменить порт для AdGuard Home в OpenWrt, вы можете выполнить следующие действия:

  1. Получите доступ к маршрутизатору OpenWrt через SSH или через веб-интерфейс LuCI.
  2. Отредактируйте файл конфигурации AdGuard Home. Этот файл обычно находится по адресу /etc/AdGuardHome.yamlили /opt/AdGuardHome/AdGuardHome.yamlв зависимости от того, как был установлен AdGuard Home.
  3. Найдите раздел в файле конфигурации, в котором указаны настройки порта. Это будет выглядеть примерно так:
bind_host: 0.0.0.0
bind_port: 443
  1. Измените bind_portзначение 443на другой номер порта, который не используется другой службой. Например, вы можете использовать 8080или 5353.
  2. Сохраните изменения в файле конфигурации.
  3. Перезапустите AdGuard Home, чтобы применить новые настройки. Вы можете сделать это, выполнив команду /etc/init.d/AdGuardHome restartили перезагрузив маршрутизатор.

Убедитесь, что выбранный вами новый порт не конфликтует с другими службами и не заблокирован настройками брандмауэра.

Если вы используете LuCI, вам также может потребоваться настроить параметры брандмауэра, чтобы разрешить трафик через новый порт. Перейдите в «Сеть» → «Брандмауэр» → «Правила трафика» и добавьте правило для нового порта.

I don't use port 443 in my yaml file. I have 53 registered. 1

ghost commented 2 months ago

That is your DNS listening port, not the HTTPS listening port.

Could you please post the rest of your yaml, redacting any private information?

fizsef commented 2 months ago

That is your DNS listening port, not the HTTPS listening port.

Could you please post the rest of your yaml, redacting any private information?

`http: pprof: port: 6060 enabled: false address: 0.0.0.0:3000 session_ttl: 720h users:

ghost commented 2 months ago

Try stopping AdGuard Home, setting port_https to a port that's not being used, then start AdGuard Home.

fizsef commented 2 months ago

Try stopping AdGuard Home, setting port_https to a port that's not being used, then start AdGuard Home.

You can see that tls is disabled, how can it use port 443? 1

ghost commented 2 months ago

I do not know whether it tries to establish that port regardless of whether it's enabled or not. I see your logic, but it's worth a try.

fizsef commented 2 months ago

I do not know whether it tries to establish that port regardless of whether it's enabled or not. I see your logic, but it's worth a try.

Yes, if I change this port value, the error disappears. But at the same time, the HTTPS port changes on the Encryption Settings page. 1 2

ghost commented 2 months ago

Yes, that's correct. You just changed the HTTPS port removing the conflict between two services trying to use the same port.

If you would like the keep AdGuard Home's HTTPS port the same, you would have to change the port LuCI uses for HTTPS.

fizsef commented 2 months ago

Да, это правильно. Вы только что изменили порт HTTPS, устранив конфликт между двумя службами, пытающимися использовать один и тот же порт.

Если вы хотите, чтобы HTTPS-порт AdGuard Home остался прежним, вам придется изменить порт, который LuCI использует для HTTPS.

And where does Luci use this port? I did not configure port 443 in Luci.

ghost commented 2 months ago

You can find it documented here.