bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget BUG: header host assign connection address


From: Petr Pisar
Subject: Re: wget BUG: header host assign connection address
Date: Tue, 22 Jun 2021 17:53:13 +0200

V Tue, Jun 22, 2021 at 02:55:29PM +0430, Pejman Taslimi napsal(a):
> The following command with any random IP retrieves google.com! Here I've
> just set a header, but wget connects really to google.com instead of
> 192.168.15.15.
> 
> $ wget -O- http://192.168.15.15 --header="Host: www.google.com"
> 
> However if I change http to https, it behaves as expected:
> 
> $ wget -O- https://192.168.15.15 --header="Host: www.google.com"
> 
> happens to the following version:
> wget-1.20.3-4.fc32.x86_64
> wget-1.21.1-2.fc32.x86_64
> 
> I wish this is the correct way of bug report, for this beloved wget!!
> 
I cannot reproduce it (wget 1.21.1 on Gentoo). I think you have set up an HTTP
proxy which intercepts the requests and forwards them to a google.com. That
would explain why HTTPS does not work for you.

You have either the proxy set in your enviroment and wget should print about:

$ wget -O /dev/null http://192.168.15.15 --header='Host: www.google.com'
--2021-06-22 17:50:31--  http://192.168.15.15/
Resolving router.bayer.uni.cx (router.bayer.uni.cx)... 2001:470:993c::1, 
10.0.0.1
Connecting to router.bayer.uni.cx 
(router.bayer.uni.cx)|2001:470:993c::1|:8118... connected.
Proxy request sent, awaiting response... 503 Connect failed
2021-06-22 17:50:31 ERROR 503: Connect failed.

or you have a transparent proxy on your network a command like this should
manifest the same problem:

$ printf "GET http://192.168.15.15/ HTTP/1.1\r\nUser-Agent: 
Wget/1.21.1\r\nAccept: */*\r\nAccept-Encoding: identity\r\nHost: 
www.google.com\r\nConnection: Keep-Alive\r\nProxy-Connection: 
Keep-Alive\r\n\r\n" | nc 192.168.15.15 80
(UNKNOWN) [192.168.15.15] 80 (http) : No route to host

-- Petr

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]