Squirrel.windows: Proxy authentication required

Created on 8 Feb 2017  路  1Comment  路  Source: Squirrel/Squirrel.Windows

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?

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bkCDL picture bkCDL  路  5Comments

mwave picture mwave  路  6Comments

CDAGaming picture CDAGaming  路  4Comments

estyfen picture estyfen  路  4Comments

Andrew-Hanlon picture Andrew-Hanlon  路  6Comments