I have a simple webproxy that requires username/password authentication. When running the update, I get a response:
The remote server returned an error: (407) Proxy Authentication Required.
Is there any guidance on how to supply proxy credentials during the update process?
Okay, I think I am going to answer my own question here for the benefit of others (and myself in 6 months time).
The problem is quite similar to https://github.com/Squirrel/Squirrel.Windows/issues/657 for which the solution is to provide your own WebClient instance to the UpdateManager constructor. You may then provide any additional proxy and credential information through that WebClient.
System.Net.WebClient c = new System.Net.WebClient();
c.Proxy = System.Net.WebRequest.DefaultWebProxy;
c.Proxy.Credentials = new System.Net.NetworkCredential("customusername", "custompwd");
using (var mgr = new UpdateManager(MySquirrelApp.Properties.Settings.Default.UpdateLocation, urlDownloader: new FileDownloader(c)))
{
await mgr.UpdateApp();
}
Using this methodology, you can get more fancy with how those credentials are set, but this would be the basics in respect to allowing custom credentials with Squirrel.
It would be super awesome if Squirrel could present a more natural way to incorporate proxy support.
Most helpful comment
Okay, I think I am going to answer my own question here for the benefit of others (and myself in 6 months time).
The problem is quite similar to https://github.com/Squirrel/Squirrel.Windows/issues/657 for which the solution is to provide your own WebClient instance to the UpdateManager constructor. You may then provide any additional proxy and credential information through that WebClient.
System.Net.WebClient c = new System.Net.WebClient(); c.Proxy = System.Net.WebRequest.DefaultWebProxy; c.Proxy.Credentials = new System.Net.NetworkCredential("customusername", "custompwd"); using (var mgr = new UpdateManager(MySquirrelApp.Properties.Settings.Default.UpdateLocation, urlDownloader: new FileDownloader(c))) { await mgr.UpdateApp(); }Using this methodology, you can get more fancy with how those credentials are set, but this would be the basics in respect to allowing custom credentials with Squirrel.
It would be super awesome if Squirrel could present a more natural way to incorporate proxy support.