Question:
I get CertEnroll::Cx509Enrollment::p_InstallResponse: ASN1 bad tag value met. 0x8009310b on IIS 7 and I am unable to install my certificate.
Answer:
This can be a result of IIS placing the certificate in the wrong certificate store or forgetting where it places the private key, in many cases it gets placed in Other People Certificate store for theCurrent User account. Only certificates that are stored in the Personal Section of the Local Computer store can be used in IIS.
Option #1: Repair a damaged certificate.
- Open up DOS prompt (cmd.exe)
- Type: certutil -repairstore my “THUMBPRINT/SERIALNUMBER”
Note: Also, sometimes the certificate is not available and needs to be imported in order for this command to work. - Go back into the IIS Manager and re-edit the bindings for this site. (Where you can select the certificate.
Note: Sometimes, you will get an error, so just ignore the error and try again. When trying again, the certificate may already be selected and nothing else needs to be done.
Option #2: Restore Certificate to the Local Computer Store
- Open the Certificate Snap-In from within the MMC (Microsoft Management Console)
Start -> Run -> Type “mmc” -> File -> Add/Remove Snap-in -> Add -> Certificates - Add Current User account.
My User Account -> Finish. - Add Local Computer account.
Computer account -> Local Computer -> Finish. - Close Add Standalone Snap-in.
- Click Ok.
- Drag the certificate that will not install, out of the Other People store and drop it under theLocal Computer -> Personal -> Certificates.
- Open up a command prompt.
Start -> Run -> Type cmd. - Type: certutil -repairstore my “THUMBPRINT_OF_CERTIFICATE”. (with quotes)
- You should now have the private key back on the certificate so now open up IIS and assign it to your website.
Now you should have a screen similar to this:
Do not close out of the MMC at this time.