Skip to content

Don't register as system proxy or install root cert by default in CI - #2093

Open
waldekmastykarz wants to merge 1 commit into
dotnet:mainfrom
waldekmastykarz:ci-default-no-system-proxy
Open

waldekmastykarz wants to merge 1 commit into
dotnet:mainfrom
waldekmastykarz:ci-default-no-system-proxy

Conversation

@waldekmastykarz

@waldekmastykarz waldekmastykarz commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

When the CI environment variable is set, Dev Proxy no longer registers itself as the system proxy or installs/trusts its root certificate by default. Explicit values in the config file (asSystemProxy, installCert) or on the command line (--as-system-proxy, --install-cert) still win. CI set via the config env section or --env is honored too.

At startup, Dev Proxy logs one line when a CI default was applied:

CI environment detected. Using asSystemProxy: false, installCert: false. To change, use --as-system-proxy and --install-cert or set asSystemProxy and installCert in the config file.

Changes:

  • ProxyConfiguration: after binding the config file, apply CI defaults for keys the config file doesn't set, and track which were defaulted.
  • DevProxyCommand: log the line above unless both values were set on the command line. The --install-cert validator now falls back to the effective config values instead of hard-coded true, so --install-cert false in CI (or with asSystemProxy: false in the config) no longer needs an explicit --as-system-proxy false.
  • Unit tests for the defaults and the log condition.
  • Updated the skill references (configuration defaults, CI/CD overview).

Release note: behavior change for CI pipelines that relied on Dev Proxy registering as the system proxy or installing the certificate. Set asSystemProxy/installCert to true in the config file or pass --as-system-proxy true/--install-cert true to keep the old behavior. The public CI/CD overview docs need a matching update.

Resolves #2059

Note: overlaps with #2089, which edits the --as-system-proxy/--install-cert option descriptions in DevProxyCommand.cs. This PR doesn't change those descriptions; it only changes the --install-cert validator lines just below, so any conflict should be trivial.

When the CI environment variable is set, asSystemProxy and installCert
default to false unless set explicitly in the config file or on the
command line. Dev Proxy logs the effective values and how to override
them at startup.

Closes dotnet#2059

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@waldekmastykarz
waldekmastykarz requested a review from a team as a code owner November 5, 2026 10:44
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified in the CI-specific proxy and certificate default changes.

No open issues 🎉

What changed in this PR

This PR makes Dev Proxy safer in CI by defaulting system proxy registration and root certificate installation to off when CI is set, while preserving explicit configuration and command-line overrides.

Changes:

  • Apply and track CI-specific defaults for asSystemProxy and installCert.
  • Log when CI defaults remain active and validate certificate options against effective configuration values.
  • Add unit tests and update configuration and CI/CD guidance.
File Description
skills/​dev-proxy/​references/​configuration.md Document CI-dependent defaults for proxy registration and certificate installation.
skills/​dev-proxy/​references/​ci-cd-integration.md Explain CI defaults, overrides, and explicit proxy setup.
DevProxy/​Proxy/​ProxyConfiguration.cs Apply CI defaults to settings omitted from configuration and track them.
DevProxy/​Commands/​DevProxyCommand.cs Use effective configuration during validation and log active CI defaults.
DevProxy.Tests/​ProxyConfigurationCiDefaultsTests.cs Test defaults, configuration overrides, and logging conditions.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't register as system proxy or install the root certificate by default when CI is set

2 participants