Skip to content

Commit

Permalink
Fix DisableAiaOptionWorks test for macOS and remove ActiveIssue
Browse files Browse the repository at this point in the history
  • Loading branch information
vcsjones authored Feb 2, 2021
1 parent f691729 commit 96019a4
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public static void EmptyAiaResponseIsIgnored()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/47492", TestPlatforms.OSX)]
public static void DisableAiaOptionWorks()
{
CertificateAuthority.BuildPrivatePki(
Expand All @@ -65,6 +64,14 @@ public static void DisableAiaOptionWorks()
cuCaStore.Open(OpenFlags.ReadWrite);

X509Chain chain = holder.Chain;

// macOS combines revocation and AIA fetching in to a single flag. Both need to be disabled
// to prevent AIA fetches.
if (PlatformDetection.IsOSX)
{
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
}

chain.ChainPolicy.DisableCertificateDownloads = true;
chain.ChainPolicy.CustomTrustStore.Add(rootCert);
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
Expand Down Expand Up @@ -102,12 +109,6 @@ public static void DisableAiaOptionWorks()
Assert.Contains(X509ChainStatusFlags.PartialChain, chain.ChainStatus.Select(s => s.Status));
holder.DisposeChainElements();

// macOS doesn't like our revocation responder, so disable revocation checks there.
if (PlatformDetection.IsOSX)
{
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
}

chain.ChainPolicy.ExtraStore.Add(intermediateCert);
Assert.True(chain.Build(endEntity), "Chain build with intermediate, AIA disabled");
Assert.Equal(3, chain.ChainElements.Count);
Expand Down

0 comments on commit 96019a4

Please sign in to comment.