-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Read system proxy information on macOS #36177
Conversation
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
… recommended flow from Chromium / WebKit
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
src/Common/src/Interop/OSX/Interop.CoreFoundation.CFDictionary.cs
Outdated
Show resolved
Hide resolved
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
Will the current environment variables (http_proxy, etc.) still work? Will they override the "system" Mac OS settings? |
No. Is that something that is desirable? |
As part of my work on Enterprise scenarios I am designing the global proxy solution for HttpClient et. al. We also have requirements for environment variables to work on Windows similar to Linux for various docker scenarios. So, the idea was that we get the standard set of Linux compatible environment variables for proxy settings to work on Windows. Thus, it would be consistent to keep them working on the Mac as well. The idea is that the environment variables, if set, would override system configured settings such as IE settings on Windows and Mac OS settings as well. We already have a class HttpEnvironmentProxy.cs to handle that. So, I would prefer we keep that working as well. But in the absence of those variables defined, then the new Mac OS system proxy config support would be used. |
It's not hard to make it working, but since the environment variables were not used on Windows as fallback I simply followed that. I could easily instantiate |
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/MacProxy.cs
Outdated
Show resolved
Hide resolved
@filipnavara Is this PR ready for a final review? Have all comments been addressed? Not sure since some of them don't have responses from you. |
@davidsh It is ready for review. The implementation of reading proxy credentials is still missing, but I don't think it should block the PR. My main use case is debugging proxies (Charles, Fiddler) where this is not necessary. |
@wfurt @stephentoub Can you do another review pass on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the PR!
did the implementation for reading linux-convention proxy environment variables ever get completed? I am facing this issue running core3.1 on CentOS 7 and it works for every other language I test except for core3.1. I'm kind of stumped. |
Yup. If you're having issues with it, can you please open a new issue with details and a repro? Thanks! |
@stephentoub absolutely. |
* Read system proxy information on macOS * Replace CFRunLoopRemoveSource with CFRunLoopSourceInvalidate to mimic recommended flow from Chromium / WebKit Commit migrated from dotnet/corefx@2aa2518
Partially fixes #26593
Tested with HTTP, HTTPS and Autoconfiguration settings. Doesn't pick-up the stored credentials yet.