Use default credentials for the proxy if none provided

The UseDefaultCredentials on WebClient (if true) will send creds to the server if requested not the proxy. The Proxy object on WebClient is a IWebProxy which only has a Credentials member (yes could probably cast to WebProxy). This change will send the default creds to the default proxy server
temp
rolen 2019-03-06 10:31:02 +00:00 committed by GitHub
parent 5bb677d3d1
commit 8a092df9d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -65,7 +65,8 @@ public class Program
proxy.BypassProxyOnLocal = false;
x.Proxy = proxy;
} else {
x.UseDefaultCredentials = true;
if (null != x.Proxy)
x.Proxy.Credentials = CredentialCache.DefaultCredentials;
}
var df = "#REPLACEDF#";