mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Merge pull request #18246 from michaelnebel/csharp/fixwarnings
C#: Fix some new compiler warnings
This commit is contained in:
@@ -604,6 +604,16 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
{
|
||||
httpClientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, _) =>
|
||||
{
|
||||
if (chain is null || cert is null)
|
||||
{
|
||||
var msg = cert is null && chain is null
|
||||
? "certificate and chain"
|
||||
: chain is null
|
||||
? "chain"
|
||||
: "certificate";
|
||||
logger.LogWarning($"Dependabot proxy certificate validation failed due to missing {msg}");
|
||||
return false;
|
||||
}
|
||||
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
|
||||
chain.ChainPolicy.CustomTrustStore.Add(this.dependabotProxy.Certificate);
|
||||
return chain.Build(cert);
|
||||
|
||||
Reference in New Issue
Block a user