You may encounter access denied error while creating certificate in .net
But you've granted permission to certFilePath folder and no issue with this.
You have no issue in development environment too.
Only occur in Production server.
How to solve?
While creating certificate, by default it will create physical cert file in server.
Since production servers are configured with limited permissions/access rights and mostly deny access by default due to security concerns, there are high chances that you will get access denied error.
So stop wasting time with access rights.
Instead, create certificate on memory using "X509KeyStorageFlags.EphemeralKeySet" flag.
Ya. this is the solution when you need to create cert temporally.
It works on both development & prod environment regardless of access rights.
and don't forgot dispose after using it.
certificate.Dispose();
.net, c#, asp.net
Comments
Post a Comment