mirror of
https://github.com/github/codeql.git
synced 2025-12-23 12:16:33 +01:00
C# Expose CertificatePath from DependabotProxy
This commit is contained in:
@@ -16,6 +16,10 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||||||
/// The full address of the Dependabot proxy, if available.
|
/// The full address of the Dependabot proxy, if available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal readonly string? Address;
|
internal readonly string? Address;
|
||||||
|
/// <summary>
|
||||||
|
/// The path to the temporary file where the certificate is stored.
|
||||||
|
/// </summary>
|
||||||
|
internal readonly string? CertificatePath;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether a Dependabot proxy is configured.
|
/// Gets a value indicating whether a Dependabot proxy is configured.
|
||||||
@@ -49,13 +53,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||||||
var certDirPath = new DirectoryInfo(Path.Join(tempWorkingDirectory.DirInfo.FullName, ".dependabot-proxy"));
|
var certDirPath = new DirectoryInfo(Path.Join(tempWorkingDirectory.DirInfo.FullName, ".dependabot-proxy"));
|
||||||
Directory.CreateDirectory(certDirPath.FullName);
|
Directory.CreateDirectory(certDirPath.FullName);
|
||||||
|
|
||||||
var certFilePath = Path.Join(certDirPath.FullName, "proxy.crt");
|
this.CertificatePath = Path.Join(certDirPath.FullName, "proxy.crt");
|
||||||
this.certFile = new FileInfo(certFilePath);
|
this.certFile = new FileInfo(this.CertificatePath);
|
||||||
|
|
||||||
using var writer = this.certFile.CreateText();
|
using var writer = this.certFile.CreateText();
|
||||||
writer.Write(cert);
|
writer.Write(cert);
|
||||||
|
|
||||||
logger.LogInfo($"Stored Dependabot proxy certificate at {certFilePath}");
|
logger.LogInfo($"Stored Dependabot proxy certificate at {this.CertificatePath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void ApplyProxy(ILogger logger, ProcessStartInfo startInfo)
|
internal void ApplyProxy(ILogger logger, ProcessStartInfo startInfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user