diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs index 96ba3452cef..c1db0b99017 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs @@ -22,7 +22,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching /// internal bool IsConfigured => !string.IsNullOrEmpty(this.Address); - internal DependabotProxy(TemporaryDirectory tempWorkingDirectory) + internal DependabotProxy(ILogger logger, TemporaryDirectory tempWorkingDirectory) { // Obtain and store the address of the Dependabot proxy, if available. this.host = Environment.GetEnvironmentVariable(EnvironmentVariableNames.ProxyHost); @@ -30,26 +30,32 @@ namespace Semmle.Extraction.CSharp.DependencyFetching if (string.IsNullOrWhiteSpace(host) || string.IsNullOrWhiteSpace(port)) { + logger.LogInfo("No Dependabot proxy credentials are configured."); return; } this.Address = $"http://{this.host}:{this.port}"; + logger.LogInfo($"Dependabot proxy configured at {this.Address}"); // Obtain and store the proxy's certificate, if available. var cert = Environment.GetEnvironmentVariable(EnvironmentVariableNames.ProxyCertificate); if (string.IsNullOrWhiteSpace(cert)) { + logger.LogInfo("No certificate configured for Dependabot proxy."); return; } var certDirPath = new DirectoryInfo(Path.Join(tempWorkingDirectory.DirInfo.FullName, ".dependabot-proxy")); Directory.CreateDirectory(certDirPath.FullName); - this.certFile = new FileInfo(Path.Join(certDirPath.FullName, "proxy.crt")); + var certFilePath = Path.Join(certDirPath.FullName, "proxy.crt"); + this.certFile = new FileInfo(certFilePath); using var writer = this.certFile.CreateText(); writer.Write(cert); + + logger.LogInfo($"Stored Dependabot proxy certificate at {certFilePath}"); } internal void ApplyProxy(ILogger logger, ProcessStartInfo startInfo) diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetCliInvoker.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetCliInvoker.cs index 522d3e9ffd4..597acc58259 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetCliInvoker.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNetCliInvoker.cs @@ -19,7 +19,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching public DotNetCliInvoker(ILogger logger, string exec, TemporaryDirectory tempWorkingDirectory) { this.logger = logger; - this.proxy = new DependabotProxy(tempWorkingDirectory); + this.proxy = new DependabotProxy(logger, tempWorkingDirectory); this.Exec = exec; logger.LogInfo($"Using .NET CLI executable: '{Exec}'"); }