0

I am trying to access a URI through HttpWebRequest and am getting the "target machine actively refused" error.

I know from a machine that has no proxy this works fine and i know my corp internet uses a PAC file to determine the proxy however it doesnt seem to be picking this up for me.

Here is what i know:

  • My app.config has
  • I presume i dont need to specify WebRequest.DefaultWebProxy but that makes no difference
  • I can explictly set the proxy with WebProxy and NetworkCredentials which works

Any ideas? Anybody have experience with PAC files and why I can access the target through IE but not through code. obviously if i hardcode the proxy it all works so it would seem that this same proxy is not being auto detected?

user1371314
  • 762
  • 7
  • 24
  • That should have read my app.config has defaultProxy useDefaultCredentials="true" – user1371314 Jun 29 '12 at 03:15
  • Well i have made progress of sorts, if i query the PAC file given a destination URL i am returned the correct proxy, I can then use the default network credentials against that and it all works fine. However i cant see why this is necessary, or does a PAC file cause issues because a proxy is unknown until a URL is given and thus HttpWebRequest.GetSystemWebProxy and similar is unable to work properly? – user1371314 Jun 29 '12 at 05:01

0 Answers0