Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a .NET 3.5 application that makes a standard http WebRequest:

var webRequest = WebRequest.Create(new Uri("http://myserver.com/target.xml));
var webResponse = webRequest.GetResponse();

This application is often deployed within networks that utilize proxies but I never really had issues with this until it was recently deployed at a client that utilizes the "Blue Coat" Proxy/Firewall.

Their proxy is configured as a transparent proxy.

The issue is that 90% of the time, my WebRequests fail with 401 Unauthorized, yet sometimes they work fine (the behavior is the same on 10+ client machines).

Also, on all of them, it works completely fine if Internet Explorer is opened first and they manually browse to one of my URL's (I checked their IE config and no proxy config is entered). Consequently, all WebRequests from my application work seamlessly.

Their network team has no suggestions but does admit to have seen "funky" behavior in the past.

Anyone have any idea what's going on here and what could be done?

share|improve this question

1 Answer 1

If you have no specific proxy defined, try this by default:

webRequest.Proxy = WebRequest.DefaultWebProxy;
webRequest.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.