0

Today i imported a certificate with mmc ( certlm.msc ) without need of any private and everything is working just fine. my question is that doesn't IIS need private key to serve a https website ? How this works ? edti : How can i import private key into windows ( i have private key in a text file along with site and ca certificate

2
  • 1
    doesn't IIS need private key to serve a https website? Yes it does, but certlm does not bind a certificate to a website.
    – Greg Askew
    Jun 15, 2022 at 11:40
  • thanks for the answer, so can i import private key in windows because i only have .pem file that has four sections 1) CSR 2) Private key 3,4) site and ca certificates
    – Salar
    Jun 15, 2022 at 12:23

1 Answer 1

2

Windows wants the private key and the certificate combined into a single PKCS#12 file. You can create one with a command like this:

openssl pkcs12 -export -out filename.p12 -inkey filename.key -in filename.cer

Or if you need to include intermediate certificates, place them all into a file (in this example, root.crt) and bundle this way:

openssl pkcs12 -export -in input.crt -inkey input.key -certfile root.crt -out bundle.p12

Once you have created this .p12 file move it over to the Windows machine and import it into the 'Certificates' snap-in within your MMC. DO NOT just click on the certificate in Explorer to start the import wizard – this will import the certificate into the personal store of the user you're logged in as, which will not work.

1
  • 1
    Thanks for the complete answer and explanation works like a charm,
    – Salar
    Jun 15, 2022 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .