Issue with Self Signed Cert in WCF - Must have Private Key

后端 未结 2 1641
谎友^
谎友^ 2021-01-12 00:04

I am creating a WCF service hosted within IIS7 on Windows Vista SP1. I am getting the following error:

The certificate \'CN=SignedByLocalHost\' must have a private k

2条回答
  •  执笔经年
    2021-01-12 00:31

    Figured it out.

    Assuming you have a self signed cert at c:\OutCert the following command will work. I had left off the -sky exchange.

    makecert -sk SignedByCA -iv c:\OutCert.pvk -n "CN=MyLocalHost" -ic c:\OutCert.cer -sr LocalMachine -ss My -sky exchange pe

    Now you can go into the MMC tool and manage the private keys and grant IIS access to the key. To manage private keys, right-click on the certificate and select All Tasks / Manage Private Keys.

提交回复
热议问题