-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
Believe it or not!
I noticed when running .NET 6 Framework on Win10 Build 1905.3324 with VS 2022 17.6.5 it seem to be important that the URL given in the System -> Proxysetting does not contain any "http://" prefixes in the address field.
As long as Proxysetting is stored with "http://", the following code always returns NULL instead of the proxy Uri
WebRequest.DefaultWebProxy.GetProxy("https://google.de")
Reproduction Steps
- create a simple console app with
WebRequest.DefaultWebProxy.GetProxy("https://google.de")to return - Configure the Win10 System -> Proxysettings to contain "http://" in the address field (E.g. Address: http://proxy.fqdn.local Port: 3128) and keep the proxy exceptions empty
- Enable and save the Proxysettings
- Run the console app and expect a NULL to be returned from
GetProxy(...)method
Expected behavior
WebRequest.DefaultWebProxy.GetProxy("https://google.de") should return the Proxy URL given in the Proxysettings of the system
Actual behavior
WebRequest.DefaultWebProxy.GetProxy("https://google.de") returns NULL
Regression?
I assume it worked on .NET 4.x since I used this framework version before migrating to .NET 6
Known Workarounds
NOW COME THE FUN PART
The workaround to use the very old "Internet option" which is still available in Win10
Since, the Proxy configuration from the "Internet options" dialog causes the proxy address to always be stored without "http://" prefix
Configuration
- .NET 6
- Win10 Build 1905.3324
- x64 platform
- Visual Studio 2022 17.6.5
Other information
No response