-
Notifications
You must be signed in to change notification settings - Fork 72
Do not always act as system proxy #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the suggestion @ohaucke. I think this is a good idea. We'll need to see if the underlying proxy API that we're using, lets us do this. As for prompting for installing and registering the certificate, I think that's separate from system-wide proxy registration. If you don't install and trust the cert, you wouldn't be able to decrypt HTTPS traffic. Could you elaborate a bit why you think you'd like to skip it? |
If you are interested, i could create a PR for that. For the implementation: if (RunTime.IsWindows && _config.ActAsSystemProxy)
{
// Only explicit proxies can be set as system proxy!
_proxyServer.SetAsSystemHttpsProxy(_explicitEndPoint);
}
else if (RunTime.IsMac && _config.ActAsSystemProxy)
{
ToggleSystemProxy(ToggleSystemProxyAction.On, _config.IPAddress, _config.Port);
}
else
{
_logger.LogWarn("Configure your operating system to use this proxy's port and address");
} The prompt for installing the certificate is handled by You are not required to install the certificate to decrypt the traffic if you ignore tls-errors in the application you are writing (Example: I just try to avoid installing additional root certificates. |
I appreciate your suggestion and explanation @ohaucke. I suggest, that we'd adjust your proposed change a bit so that we check for the config only once, eg: if (_config.ActAsSystemProxy)
{
if (RunTime.IsWindows) ....
} We'd also do the same check when closing proxy and cleaning up system proxy settings. @garrytrinder, any additional considerations before we proceed? |
Sounds good to me 👍 |
In this case, I prefer nesting so that we can manage the behavior in one place and avoid inconsistencies. |
To make it work consistently on macOS, we'd also need to factor in: |
Nothing to add. |
In that case, all yours @ohaucke if you're still interested to work on it 😊 |
All right, gonna work on it at this weekend 😄 |
Awesome! Looking forward to seeing your PR |
I've decided against nesting the conditions because it would either result in the same condition multiple times or the same |
…cert (#530) * Add --do-not-act-as-system-proxy option #505 * Add --do-not-install-self-signed-cert option #505 * Remove unnecessary launch settings * Rename launch options to avoid double negations * Run EnsureRootCertificate only on non-windows OS * Rework AsSystemProxy condition * Combine conditions in FirstRunSetup * Update --as-system-proxy description * Unify EOL in ProxyHost * Adds comment * Update ProxyHost.cs * Change loading of cert if it should not be installed --------- Co-authored-by: Waldek Mastykarz <[email protected]>
Done with #530 @waldekmastykarz Thanks for your time and testing :) |
And thank you for working with us! 👏 |
Currently, if you run devproxy on windows, it will always act as a system proxy.
Even though it's on explicit endpoints, it's not always desired.
See: https://github.com/microsoft/dev-proxy/blob/c74843f3a30c46577dfd7b804ea032626711bab9/dev-proxy/ProxyEngine.cs#L122C48-L122C65
My suggestion would be to add an additional option to not act as system proxy.
This way the user can decide which applications should be routed through the proxy (and you don't get asked to install the certificate).
The text was updated successfully, but these errors were encountered: