Ask a Question

Advanced Search

Solution ID : SO15905

Last Modified : 05/02/2018

Error: CertEnroll::CX509Enrollment::p_InstallResponse: ASN1 bad tag value met.0x8009310b installing cert on IIS 7


When attempting to install a certificate in IIS7, an alert appears with the following error:

There was an error while performing this operation.


CertEnroll::CX509Enrollment::p_InstallResponse: ASN1 bad tag value met. 0x8009310b 

This error is caused by a mismatched private key. If the private key is still on the server, it may be possible to install the certificate and restore the private key. The following resolution may correct the error; if it doesn't work, the certificate must be replaced.


Import certificate in to the Computer certificate store

  1. Create a Certificate snap-in in a MMC console.
  2. In the left-hand pane, expand the Certificates folder, expand and select the Personal folder.
  3. Right-click the Certificates folder inside the Personal folder, select All Tasks, select Import.
  4. The Certificate Import Wizard opens. Click Next.
  5. Click Browse and then navigate to the file that contains the SSL certificate. Click Open, then click Next.
  6. Ensure Place all certificates in the following store is selected, ensure that Personal is listed for Certificate store
  7. Click Next, then click Finish.

Restore Private Key

  1. With the MMC console still open, select the Certificates folder inside the Personal folder in the left-hand pane.
  2. Double-click the newly imported SSL certificate in the right-hand pane, then select the Details tab.
  3. Scroll down and select the Thumbprint field, then select and copy the entire thumbprint (in the bottom box) to the clipboard.
  4. Open a command prompt, then enter the following command:
    certutil -repairstore my "[certificate thumbprint]"

    certutil -repairstore my "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f"

    If successful, the response will be "CertUtil: -repairstore command completed successfully".  At this point the certificate can be assigned to the site.

    If the certutil command fails, a new CSR will need to be generated and the certificate replaced.

Assign SSL certificate in IIS

  1. Open the IIS Manager application.
  2. From the Connections pane on the left, expand the local server, expand the Sites folder and select the web site to be secured with SSL.
  3. From the Actions pane on the right, select the Bindings option (under Edit Site).
  4. In the Site Bindings window, select an existing https binding and click Edit. If there are no existing https bindings, click Add.
  5. Ensure the type is set to https, then select the new SSL certificate from the drop down menu. Click the View button to confirm details of the certificate, if necessary. Click OK, then click Close