I am trying to read a certificate from an ASP.NET application running under mod_mono on Apache2. When I attempt to read this certificate from the certificate store, I get the following exception:
The specified certificate, CN=WildcatApp-05a059c9-c309-46af-9b86-b06d42510550, could not be found in the LocalMachine certificate store,or the certificate does not have a private key. Description: HTTP 500. Error processing request. Stack Trace: System.Security.SecurityException: The specified certificate, CN=WildcatApp-05a059c9-c309-46af-9b86-b06d42510550, could not be found in the LocalMachine certificate store,or the certificate does not have a private key. at Microsoft.Health.ApplicationConfiguration.GetSignatureCertRsaProvider (Guid applicationId, System.Security.Cryptography.RSACryptoServiceProvider& rsaProvider, System.String& thumbprint) [0x00000] at Microsoft.Health.Web.Authentication.WebApplicationCredential.SetupSignatureCertRsaProvider () [0x00000] at Microsoft.Health.Web.Authentication.WebApplicationCredential.Initialize (Guid applicationId) [0x00000] at Microsoft.Health.Web.Authentication.WebApplicationCredential..ctor (Guid applicationId, System.String subCredential) [0x00000] at Microsoft.Health.Web.WebApplicationUtilities.GetPersonInfo (System.String authToken) [0x00000] at Microsoft.Health.Web.WebApplicationUtilities.HandleTokenOnUrl (System.Web.HttpContext context, Boolean isLoginRequired) [0x00000] at Microsoft.Health.Web.WebApplicationUtilities.PageOnPreLoad (System.Web.HttpContext context, Boolean logOnRequired) [0x00000] at Microsoft.Health.Web.HealthServicePage.OnPreLoad (System.EventArgs e) [0x00000] at System.Web.UI.Page.ProcessLoad () [0x00000] at System.Web.UI.Page.ProcessPostData () [0x00000] at System.Web.UI.Page.InternalProcessRequest () [0x00000] at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] I had imported this PVK file using certmgr using both of the following commands: sudo certmgr -add -c -m My HelloWorld-SDK_ID-05a059c9-c309-46af-9b86-b06d42510550.pfx sudo certmgr -add -c -m Trust HelloWorld-SDK_ID-05a059c9-c309-46af-9b86-b06d42510550.pfx Although the import succeeded, the site was not able to access the certificate from the store. I then attempted to store the PVK file on the file system and simply have the application load it at runtime from the PVK file. This technique (as well as the previous one) work fine on Windows, but when making this change I get the following error when the site attempts to read the cert: Input data cannot be coded as a valid certificate. System.Security.Cryptography.CryptographicException: Input data cannot be coded as a valid certificate. at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] Can anyone give me a pointer as to what the problem here is, and what the workaround is? This seems to be the major roadblock in my being able to deploy this app under Mono. Thanks. Jason Harmon -- View this message in context: http://www.nabble.com/Unable-to-read-certificate-using-mod_mono-on-Apache2-Ubuntu-tp25034809p25034809.html Sent from the Mono - ASP.NET mailing list archive at Nabble.com. _______________________________________________ Mono-aspnet-list mailing list [email protected] http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
