diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs index e31f2c3a84a0cf..a519f7a7ccb69b 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs @@ -899,7 +899,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));