Lissy93/AdGuardian-Term

Support HTTPS connections

Closed this issue · 5 comments

I expose my Adguard instances over https and right now it doesn't appear possible to connect regardless of the IP/hostname or port provided.

I don't know Rust well, but I'm guessing this is hardcoding http as the protocol scheme https://github.com/Lissy93/AdGuardian-Term/blob/main/src/main.rs#L27

@Lissy93 Do you think making the protocol configurable would resolve this issue or do you expect there is more involved?

If so would it make sense to add and env var for protocol? I'm new to rust but I'm not seeing how/if those values are defaulted if not set?

This deffo makes sense to implement (for all you sensible people who use https!)

I think you're right @thespad with your suggestion to make the protocol user-settable. I've implemented this, and updated the docs in #9 which I'll merge shortly :)

when I use --adguard-protocol "https" it still wants to do http??

ADGUARD_IP is set to 192.168.11.53
ADGUARD_PORT is set to 443
ADGUARD_PROTOCOL is set to http
ADGUARD_USERNAME is set to admin
ADGUARD_PASSWORD is set to ***

Verifying connection to your AdGuard instance...
Failed to connect to AdGuard at 192.168.11.53:443

Looking at the doc/PR I think the cli arg --adguard-protocol does not exist. (https://github.com/Lissy93/AdGuardian-Term#configuring)

You must set the environment variable ADGUARD_PROTOCOL=https

Running the Linux executable adguardian-x86_64 with the hostname in _IP gives:
error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

Running it with the IP address gives:
error trying to connect: presented server name type wasn't supported

curl works fine on the control/status endpoint.