Home » Asp.net

X509Certificate2Collection stop working


i have the falowing methos used on my website to capture client certificates that is instaled on the server and he works frequently well


        public X509Certificate2Collection ListarCertificados()
            X509Certificate2 oX509Cert = new X509Certificate2();
            X509Store store = new X509Store(StoreLocation.CurrentUser);
            store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
            X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
            X509Certificate2Collection collection1 = (X509Certificate2Collection)collection.Find(X509FindType.FindByTimeValid, DateTime.Now, false);
            return (X509Certificate2Collection)collection.Find(X509FindType.FindByKeyUsage, X509KeyUsageFlags.DigitalSignature, false);


The Problem is that for some times he works return the certificates but from a time to other he stop working and nothing return with no errors the only way to he become working again is to stop and start the Application Pool in IIS

Someone have and idea ???



2 Answers Found


Answer 1


return with no errors

Then what is happened this time? Is there any symptoms?

May be you can have a look at these links:



Hope this can help you.


Answer 2



The method simple dont bring anything  



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure