Skip to content

Commit

Permalink
Merge pull request #18469 from github/mbg/csharp/fix-crash-if-proxy-e…
Browse files Browse the repository at this point in the history
…nv-vars-are-already-set

C#: Fix crash if proxy environment variables are already set
  • Loading branch information
mbg authored Jan 10, 2025
2 parents b598264 + b0f0a24 commit 1cba147
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public class DependabotProxy : IDisposable

if (!string.IsNullOrWhiteSpace(cert))
{
logger.LogInfo("No certificate configured for Dependabot proxy.");

var certDirPath = new DirectoryInfo(Path.Join(tempWorkingDirectory.DirInfo.FullName, ".dependabot-proxy"));
Directory.CreateDirectory(certDirPath.FullName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ private ProcessStartInfo MakeDotnetStartInfo(string args, string? workingDirecto
{
logger.LogInfo($"Setting up Dependabot proxy at {this.proxy.Address}");

startInfo.EnvironmentVariables.Add("HTTP_PROXY", this.proxy.Address);
startInfo.EnvironmentVariables.Add("HTTPS_PROXY", this.proxy.Address);
startInfo.EnvironmentVariables.Add("SSL_CERT_FILE", this.proxy.CertificatePath);
startInfo.EnvironmentVariables["HTTP_PROXY"] = this.proxy.Address;
startInfo.EnvironmentVariables["HTTPS_PROXY"] = this.proxy.Address;
startInfo.EnvironmentVariables["SSL_CERT_FILE"] = this.proxy.CertificatePath;
}

return startInfo;
Expand Down

0 comments on commit 1cba147

Please sign in to comment.