Windows CertReq command line utility fails when trying to accept a certificate as an user (personal) certificate

Posted: (EET/GMT+2)

 

I was today trying to install some SSL sertificates into an Azure web site, and one part of the instructions says that you should use the command "certreq -accept -user" along with your certificate file.

However, on my two Windows 8.1 computers, I get the following error message:

C:\Stuff>certreq -accept -user "MyWebServer.cer"
Certificate Request Processor: Cannot find object or property.
0x80092004 (-2146885628 CRYPT_E_NOT_FOUND).

And no, this error message is not related to running this command on a computer where you didn't make the original certificate request, nor does this relate to not using proper administrator rights.

Although the real reason for this error is unclear to me, there's an easy remedy: change the certificate store location to the machine instead of the user. So to fix the error, use "certreq -accept -machine" instead:

certreq -accept -machine "MyWebServer.cer"

To find your certificate, you need to navigate to the computer certificates using the Microsoft Management Console (MMC). You cannot find this certificate from the current user's certificate store (certmgr.msc).