diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedDirectoryStoreProvider.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedDirectoryStoreProvider.cs index da0fc5dff15808..decc699c4495d4 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedDirectoryStoreProvider.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedDirectoryStoreProvider.cs @@ -46,6 +46,8 @@ internal SafeX509StackHandle GetNativeCollection() { _storeDirectoryInfo.Refresh(); DirectoryInfo info = _storeDirectoryInfo; + ret = _nativeCollection; + elapsed = _recheckStopwatch.Elapsed; if (ret == null || _forceRefresh || diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs index e66b3d1ad11022..57566692d087a2 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslCachedSystemStoreProvider.cs @@ -93,6 +93,9 @@ private static Tuple GetCollections() { lock (s_recheckStopwatch) { + ret = s_nativeCollections; + elapsed = s_recheckStopwatch.Elapsed; + if (ret == null || elapsed > s_assumeInvalidInterval || LastWriteTimesHaveChanged())