From 5c6b37603fb286962d757c23828060150ada8b31 Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 3 May 2023 11:13:00 -0400 Subject: [PATCH] See if we can specify the validation date for the certificates (#28) --- test/CertPinningTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/CertPinningTest.cs b/test/CertPinningTest.cs index 9c77f86..9383475 100644 --- a/test/CertPinningTest.cs +++ b/test/CertPinningTest.cs @@ -22,6 +22,8 @@ protected static X509Chain DuoApiChain() { // The certificate chain for api-*.duosecurity.com var chain = new X509Chain(); + // Verify as of a date that the certs are valid for + chain.ChainPolicy.VerificationTime = new DateTime(2023, 01, 01); chain.ChainPolicy.ExtraStore.Add(CertFromString(DUO_API_CERT_ROOT)); chain.ChainPolicy.ExtraStore.Add(CertFromString(DUO_API_CERT_INTER)); bool valid = chain.Build(DuoApiServerCert()); @@ -33,6 +35,8 @@ protected static X509Chain MicrosoftComChain() { // A valid chain, but for www.microsoft.com, not Duo var chain = new X509Chain(); + // Verify as of a date that the certs are valid for + chain.ChainPolicy.VerificationTime = new DateTime(2023, 01, 01); chain.ChainPolicy.ExtraStore.Add(CertFromString(MICROSOFT_COM_CERT_ROOT)); chain.ChainPolicy.ExtraStore.Add(CertFromString(MICROSOFT_COM_CERT_INTER)); bool valid = chain.Build(CertFromString(MICROSOFT_COM_CERT_SERVER));