Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Update > SOLUTION: WPAD seems to be ignored

Reply
Thread Tools Display Modes

SOLUTION: WPAD seems to be ignored

 
 
Christopher Hill
Guest
Posts: n/a

 
      10-21-2004
Hi,

I'm just here to report a solution to a rather annoying
problem that I've had recently.

We use WPAD on our network to automatically set up clients
to use our proxy servers. It's pretty well documented
inside this newsgroup.

However, what most people *don't* know is that the WinHTTP
client that is supplied with Windows XP SP1 is broken for
some common WPAD functions, and you need to put in a
workaround in your WPAD scripts to get your clients to
update.

See the following KB article for more details of the bug:
http://support.microsoft.com/?kbid=816941

Basically, the WPAD functions isResolvable, dnsResolve and
myIpAddress all return 'FALSE' instead of the actual
values.
If, like me, you have a script that is something like this:

if (isInNet(myIpAddress(), "10.35.104.0", "255.255.254.0"))
return "PROXY 10.35.104.99:8080";

then if the buggy WinHTTP client reaches this line in your
script it will FAIL because myIpAddress will return FALSE
instead of a string value. This presumably causes isInNet
to throw an exception (presumably because of a type
mismatch), which causes the Javascript engine to *fail*,
and WinHTTP will assume that you have a bad WPAD script,
ignore your proxy settings, and attempt to contact the
Windows Update servers directly. This may result in a
0x80072EE2 or 0x80072EFD error if your firewall doesn't
allow direct connections to servers.

The latest WinHTTP client has this problem fixed, but
unfortunately the WinHTTP client is updated through
Windows Update, so you're in a bit of a catch-22, because
you can't get onto Windows Update because WinHTTP is
broken

What is the solution? Put in a sanity check in your WPAD
script BEFORE any lines that use isResolvable, dnsResolve
or myIpAddress, like so:

if (!isResolvable("localhost"))
return "PROXY <proxy server>:<proxy port>";

On a working WinHTTP client (and any other WPAD capable
client), you will ALWAYS be able to resolve 'localhost',
without even checking any DNS servers, so this line will
be ignored. On a non-working WinHTTP client you won't be
able to resolve even 'localhost', and the WPAD client will
use the proxy you specify, without running the rest of the
script, and hence without throwing an exception.

Also, note that the proxy server you specify in
this 'sanity check' MUST be available to all the clients
that are using this WPAD script, which might be a problem
depending on your firewall config.

Hope this helps some people out who are struggling with
this as much as I did!

Regards,

Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
solution Windows Vista Mail 3 03-23-2009 11:44 AM
still no solution Ermagicman Windows Vista Mail 4 01-02-2009 01:02 AM
Is there a solution yet? Bonnie. Windows Vista General Discussion 0 06-05-2007 04:58 AM
Windows Update v5 and Wpad Antonio Windows Update 0 09-01-2004 12:06 PM
Solution Solution for Error 0x800C0008 Windows Update 0 05-06-2004 06:31 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59