Skip to content

Commit a52a549

Browse files
authored
Merge pull request #18246 from michaelnebel/csharp/fixwarnings
C#: Fix some new compiler warnings
2 parents 5d18e23 + 684c80c commit a52a549

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

csharp/.config/dotnet-tools.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"isRoot": true,
44
"tools": {
55
"paket": {
6-
"version": "9.0.1",
6+
"version": "9.0.2",
77
"commands": [
88
"paket"
99
]
1010
}
1111
}
12-
}
12+
}

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

+10
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,16 @@ private bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount,
604604
{
605605
httpClientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, _) =>
606606
{
607+
if (chain is null || cert is null)
608+
{
609+
var msg = cert is null && chain is null
610+
? "certificate and chain"
611+
: chain is null
612+
? "chain"
613+
: "certificate";
614+
logger.LogWarning($"Dependabot proxy certificate validation failed due to missing {msg}");
615+
return false;
616+
}
607617
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
608618
chain.ChainPolicy.CustomTrustStore.Add(this.dependabotProxy.Certificate);
609619
return chain.Build(cert);

csharp/paket.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)