Skip to content

WebClient http proxy broken in .Net Core 3 Preview 7 #30418

@roglainc

Description

@roglainc

I am using WebClient and HttpWebRequest to call external Http APIs and is dependent on a proxy to make external calls. After upgrading to .Net Core Preview 7 I get Proxy authentication error (407). The code runs ok in .Net Core 2.1, and .Net Core 3 preview 3.

This is a snippet that
succeeds on .Net Core 2.1 & 3.0 preview 3
but fails on preview 7,
running in Visual Studio 2019 16.2.0:

            string proxy = <_name of Proxy_>;
            string url = "https://www.kemi.se/global/faktablad/faktablad-om-sakerhetsdatablad.pdf";
            var client = new WebClient() {
                Proxy = new WebProxy(proxy, 8080) {
                    UseDefaultCredentials = true
                }
            };
            var data = client.DownloadData(url);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions