tinyproxy / tinyproxy

tinyproxy - a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems
GNU General Public License v2.0
4.67k stars 645 forks source link

tinyproxy doesn't resolve SRV records #517

Open thulle opened 8 months ago

thulle commented 8 months ago

Tinyproxy version

1.11.0-1, ubuntu package

Issue

Using CONNECT fails when the target host only has SRV-records

CONNECT   Oct 26 19:00:28.268 [1538]: Connect (file descriptor 3): 172.16.0.2
CONNECT   Oct 26 19:00:28.271 [1538]: Request (file descriptor 3): CONNECT packages.netgate.com:443 HTTP/1.1
INFO      Oct 26 19:00:28.272 [1538]: No upstream proxy for packages.netgate.com
INFO      Oct 26 19:00:28.274 [1538]: opensock: opening connection to packages.netgate.com:443
ERROR     Oct 26 19:00:28.329 [1538]: opensock: Could not retrieve address info for packages.netgate.com:443: No address associated with hostname

packages.netgate.com doesn't have A/AAAA-records, but it does have SRV-records:

$ host -t srv _https._tcp.packages.netgate.com _https._tcp.packages.netgate.com has SRV record 10 10 443 pkg00-atx.netgate.com. _https._tcp.packages.netgate.com has SRV record 10 10 443 pkg01-atx.netgate.com.

rofl0r commented 8 months ago

tinyproxy, like most network applications, uses the standard libc resolver (getaddrinfo), which usually supports only A or AAAA records. writing custom DNS code for your special case is out of scope for tinyproxy development.