Skip to content

Commit a1eb1b8

Browse files
authored
skip SslStream_ClientCertificate_SendsChain test if chain is not valid (#48261)
* skip SslStream_ClientCertificate_SendsChain test if chain is not valid * make test conditional
1 parent 66c1b84 commit a1eb1b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public async Task SslStream_UntrustedCaWithCustomCallback_Throws(bool customCall
349349
}
350350
}
351351

352-
[Fact]
352+
[ConditionalFact]
353353
[ActiveIssue("https://github.com/dotnet/runtime/issues/46837", TestPlatforms.OSX)]
354354
public async Task SslStream_ClientCertificate_SendsChain()
355355
{
@@ -371,7 +371,10 @@ public async Task SslStream_ClientCertificate_SendsChain()
371371
chain.ChainPolicy.DisableCertificateDownloads = false;
372372
bool chainStatus = chain.Build(clientCertificate);
373373
// Verify we can construct full chain
374-
Assert.True(chain.ChainElements.Count >= clientChain.Count, "chain cannot be built");
374+
if (chain.ChainElements.Count < clientChain.Count)
375+
{
376+
throw new SkipTestException($"chain cannot be built {chain.ChainElements.Count}");
377+
}
375378
}
376379

377380
var clientOptions = new SslClientAuthenticationOptions() { TargetHost = "localhost", };

0 commit comments

Comments
 (0)