markembling / MarkEmbling.PostcodesIO

.NET library for interacting with the excellent Postcodes.io service.
MIT License
23 stars 16 forks source link

Issue with proxy/proxy Windows auth under .NET Core on Windows (.NET standard lib) #14

Closed markembling closed 2 years ago

markembling commented 5 years ago

407 proxy authentication required: default system proxy and authentication seems to not be working as expected. Apparently a side-effect of using RestSharp on .NET Core rather than .NET Framework.

Needs more investigation.

markembling commented 5 years ago

Adding this in Execute and ExecuteAsync methods seems to fix it in those circumstances but it doesn't seem normal to do this...

        client.Proxy = new System.Net.WebProxy();
        client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

Plus it needs to be checked what side effects this has in a non-proxy environment.