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

后端 未结 7 456
隐瞒了意图╮
隐瞒了意图╮ 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:17

    Using PowerShell

    From Windows 8.1 and Windows Server 2012 R2 (Windows PowerShell 4.0) and upwards, you can create a self-signed certificate using the new New-SelfSignedCertificate cmdlet:

    Examples:

    New-SelfSignedCertificate -DnsName www.mydomain.com -CertStoreLocation cert:\LocalMachine\My
    
    New-SelfSignedCertificate -DnsName subdomain.mydomain.com -CertStoreLocation cert:\LocalMachine\My
    
    New-SelfSignedCertificate -DnsName *.mydomain.com -CertStoreLocation cert:\LocalMachine\My
    

    Using the IIS Manager

    1. Launch the IIS Manager
    2. At the server level, under IIS, select Server Certificates
    3. On the right hand side under Actions select Create Self-Signed Certificate
    4. Where it says "Specify a friendly name for the certificate" type in an appropriate name for reference.
      1. Examples: www.domain.com or subdomain.domain.com
    5. Then, select your website from the list on the left hand side
    6. On the right hand side under Actions select Bindings
    7. Add a new HTTPS binding and select the certificate you just created (if your certificate is a wildcard certificate you'll need to specify a hostname)
    8. Click OK and test it out.

提交回复
热议问题