http://bugs.winehq.org/show_bug.cgi?id=32438
Bug #: 32438 Summary: winhttp:winhttp conformance test WinHttpGetProxyForUrl() failure Product: Wine Version: 1.5.19 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: winhttp AssignedTo: wine-bugs@winehq.org ReportedBy: fgouget@codeweavers.com Classification: Unclassified
My laptop gets the following test failure (see the fg-acer64-* winetest results):
winhttp.c:2700: Test failed: got 12166
I looked into this and what's special about it is that its fqdn is 'hawai.free.fr'. I'm not 100% sure how this happens but I think it makes sense given that my ISP is free.fr so this is just the combination of the hostname 'hawai' and the default domain 'free.fr' (my other machines are on various private domains).
This causes WinHttpDetectAutoProxyConfigUrl() to check if wpad.free.fr is resolvable, which it is. So it succeeds and returns:
The problem is that wpad.free.fr is hosted on a virtual web host(1). That is a single web server with a single IP address hosts multiple web sites and uses the Host field in the HTTP header to determine which site is being accessed. So accessing this page by IP address fails while accessing it as http://wpad.free.fr/wpad.dat succeeds.
This error then causes WinHttpGetProxyForUrl() to fail because the string it is given to parse is an HTML HTTP 500 error page. I have confirmed that if WinHttpGetProxyForUrl() return http://wpad.free.fr/wpad.dat the test succeeds.
So why does WinHttpGetProxyForUrl() use the IP address to build the URL?
On Windows I could not get WinHttpDetectAutoProxyConfigUrl() to return anything but ERROR_WINHTTP_AUTODETECTION_FAILED. I suspect it gets a different domain name somehow.
(1) https://en.wikipedia.org/wiki/Virtual_hosting#Name-based