I'm trying to create a website which uses SSL with a self-signed certificate.
Here's what I do:
Create authority certificate:
makecert -n "CN=root signing authority" -r -sv root.pvk root.cer
Create target certificate
makecert -r -pe -n "CN=localhost" -b 01/01/2012 -e 01/01/2020 -sky exchange localhost.cer -sv localhost.pvk
Sign the created certificate
makecert -ic root.cer -iv root.pvk -n "CN=localhost" -sv localhost.pvk -pe -sky exchange localhost.cer
Create a certificate with private key inside
pvk2pfx.exe -pvk localhost.pvk -spc localhost.cer -pfx localhost.pfx
Now, I want to use firefox for debugging website. To do that, I need to import the authority root certificate (root.cer) into the trusted certificate list.
However, when I'm trying to do this, I'm getting following error message:
This is not a certificate authority certificate, so it can't be imported into the certificate authority list.
I've done something similar with fiddler's authority certificate, and it went fine, which means that there's a problem with my process of creating authority certificate.
How do I properly create certificate authority certificates?
To create self-signed certificates, use the Powershell Cmdlet New-SelfSignedCertificate. The MakeCert tool creates an X. 509 certificate, signed by the test root key or other specified key, that binds your name to the public part of the key pair. The certificate is saved to a file, a system certificate store, or both.
Expand Policies > Windows Settings > Security Settings > Public Key Policies. Right-click Trusted Root Certification Authorities and select Import. Click Next and Browse to select the CA certificate you copied to the device. Click Finish and then OK.
Maybe you could try adding the -cy authority parameter on the root certificate creation, like that:
makecert -n "CN=root signing authority" -cy authority -r -sv root.pvk root.cer
Thus you declare you are creating an authority certificate and that should do the job.. or at least take you on track =)
I tried myself to create a root certificate using this commandline and to import it into Firefox: I can confirm that if you don't add the "-cy" parameter, Firefox will not consider that a valid root certificate.
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With