Friday, 20 May 2016

Certificate Generation in IIS throws "Cannot find the certificate request that is associated with this certificate file. A certificate request must be completed on the computer where the request was created."

You are trying to generate a self-signed certificate for a SQL database service, after creating the CSR from IIS you try to Complete the CSR request and receive the following error "Cannot find the certificate request that is associated with this certificate file. A certificate request must be completed on the computer where the request was created."

The fix here is to open the Certificates MMC under the Local Computer. Expand Certificate Enrollments Request and then Certificates.

Right click and select the Properties of the certificate request that is present. Now populate the Friendly Name field and click OK.

This will resolve the error and effectively complete the certificate signing request. Now if you have to export this certificate to other devices, double click on the Certificate and click the Details tab.
From there click Copy to File..., run through the wizard and ensure you tick the box to export the private key. This will generate PFX file with the public/private key contained within.