How to created a certificate Issued to localhost in IIS 7.5 RRS feed

  • Question

  • Hi

    Im developing with Windows 7 and I found this one thing blocking me.

    I need certificates as part of my WCF project. I was able to issue a certificate for

    Everything works fine but since I have this certificate with long name specified I have to use it everywhere and I have lot less debugging options.

    Everything worked fine when I used localhost in address, however I do not know how to create self-signed certs for localhost since IIS management tool automaticly places my domain name in the cert I wanna create. IS there a way for generating a certificate for localhost explicitly?


    I am not able to turn of certificate requests in my Project for development purposes so this one is out of question.

    Tuesday, April 19, 2011 3:35 PM


  • Found a better, shorter solution:


    makecert -r -n "CN=localhost" -b 01/01/2000 -e 01/01/2099 -eku -sv localhost.pvk localhost.cer
    cert2spc localhost.cer localhost.spc
    pvk2pfx -pvk localhost.pvk -spc localhost.spc -pfx localhost.pfx


    These 3 commands do the trick. As a result you have a pfx (required by IIS 7.5) file which then can easily be imported to IIS.

    • Marked as answer by mkarpinski Wednesday, April 20, 2011 8:48 AM
    Wednesday, April 20, 2011 8:47 AM

All replies