Recently I had to deal with an issue at work where I had to install a new ssl cert on a server quickly but the person with the account details for the signing authority was unavailable. The person responsible had generated a ".cer" file but using the wrong ".csr" file from another server so when I went to install the cert I got this error.
ASN1 bad tag value met
Fortunately they had also sent me a ".crt" file for this cert so I was able to get that installed using this workaround.
To start we first must import the ".crt" file into the Personal Certificate Store on the server. To do this:
At this stage the certificates snap-in should be loaded into the tree nav on the left. From here:
At this point the imported certificate is only a half-certificate as it is still missing its private key. To add the private key we use the CertUtil program to "repair" the certificate.
The command you’ll want to run is:
certutil -repairstore my "paste in the characters from notepad here"
When you run this command you should get back this message.
CertUtil: -repairstore command completed successfully
If you have done everything correctly the certificate should now be valid for this server and be available for your websites to use in IIS.