Skip to content
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

C#: Set proxy environment variables, if Dependabot proxy is detected #18029

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mbg
Copy link
Member

@mbg mbg commented Nov 19, 2024

This PR is part of work to enable private package registries to be used in default setup.

The existing default setup workflow will initialise the Dependabot package proxy if a private package registry configuration is configured. The host, port, and certificate used by the proxy are then passed to CodeQL in the analyze step.

The changes in this PR modify the C# extractor to recognise when the corresponding environment variables are set. If so, we use the data from those environment variables to:

  1. Construct the proxy address from the host and port and pass it to dotnet via the HTTP_PROXY and HTTPS_PROXY environment variables.
  2. Store the certificate on disk, and pass the path to dotnet via SSL_CERT_FILE.

In testing so far, this works fine on Linux with fairly arbitrary versions of dotnet. It does not seem to work on macOS and likely also does not work on Windows.

@mbg mbg self-assigned this Nov 19, 2024
@github-actions github-actions bot added the C# label Nov 19, 2024
@mbg mbg force-pushed the mbg/csharp/set-proxy-cert-file branch from c5c1260 to 9731006 Compare November 19, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant