diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs index 35e9ce439f28d6..0392b093e87d7c 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs @@ -900,7 +900,13 @@ public static void X509ChainElementCollection_CopyTo_NonZeroLowerBound_ThrowsInd chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags; - chain.Build(microsoftDotCom); + // Halfway between microsoftDotCom's NotBefore and NotAfter + // This isn't a boundary condition test. + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); + + bool valid = chain.Build(microsoftDotCom); + Assert.True(valid, "Precondition: Chain built validly"); + ICollection collection = chain.ChainElements; Array array = Array.CreateInstance(typeof(object), new int[] { 10 }, new int[] { 10 }); Assert.Throws(() => collection.CopyTo(array, 0));