How to create a self-signed certificate for a domain name for development?

后端 未结 7 459
隐瞒了意图╮
隐瞒了意图╮ 2020-11-29 14:49

I have subdomain.example.com that I use for development purposes. My web application solution contains a web API etc, that I need to call from external systems,

7条回答
  •  难免孤独
    2020-11-29 15:01

    To Create the new certificate for your specific domain:

    Open Powershell ISE as admin, run the command:

    New-SelfSignedCertificate -DnsName *.mydomain.com, localhost -CertStoreLocation cert:\LocalMachine\My
    

    To trust the new certificate:

    • Open mmc.exe
    • Go to Console Root -> Certificates (Local Computer) -> Personal
    • Select the certificate you have created, do right click -> All Tasks -> Export and follow the export wizard to create a .pfx file
    • Go to Console Root -> Certificates -> Trusted Root Certification Authorities and import the new .pfx file

    To bind the certificate to your site:

    • Open IIS Manager
    • Select your site and choose Edit Site -> Bindings in the right pane
    • Add new https binding with the correct hostname and the new certificate

提交回复
热议问题