Skip to content

Commit 1cba147

Browse files
authored
Merge pull request github#18469 from github/mbg/csharp/fix-crash-if-proxy-env-vars-are-already-set
C#: Fix crash if proxy environment variables are already set
2 parents b598264 + b0f0a24 commit 1cba147

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public class DependabotProxy : IDisposable
5252

5353
if (!string.IsNullOrWhiteSpace(cert))
5454
{
55-
logger.LogInfo("No certificate configured for Dependabot proxy.");
56-
5755
var certDirPath = new DirectoryInfo(Path.Join(tempWorkingDirectory.DirInfo.FullName, ".dependabot-proxy"));
5856
Directory.CreateDirectory(certDirPath.FullName);
5957

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetCliInvoker.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ private ProcessStartInfo MakeDotnetStartInfo(string args, string? workingDirecto
4646
{
4747
logger.LogInfo($"Setting up Dependabot proxy at {this.proxy.Address}");
4848

49-
startInfo.EnvironmentVariables.Add("HTTP_PROXY", this.proxy.Address);
50-
startInfo.EnvironmentVariables.Add("HTTPS_PROXY", this.proxy.Address);
51-
startInfo.EnvironmentVariables.Add("SSL_CERT_FILE", this.proxy.CertificatePath);
49+
startInfo.EnvironmentVariables["HTTP_PROXY"] = this.proxy.Address;
50+
startInfo.EnvironmentVariables["HTTPS_PROXY"] = this.proxy.Address;
51+
startInfo.EnvironmentVariables["SSL_CERT_FILE"] = this.proxy.CertificatePath;
5252
}
5353

5454
return startInfo;

0 commit comments

Comments
 (0)