First, install OpenSSL open OpenSSL.exe require Administrator privileges
Second, input genrsa-out Myself.key 1024,myself.key The name of the key at random, 1024 for the key length
Generates Myself.key files.
Third, input Req-new-x509-key myself.key-out myself.cer-days 365-subj/cn=www.mysite.com
Myself.key is the name of the key that was generated before, Myself.cer is the generated certificate, 365 is the certificate expiration days, and the CN parameter www.mysite.com is your host name.
The certificate file Myself.cer was generated.
Four, the private key file for a PFX is required in IIS.
Enter Pkcs12-export-out Myself.pfx-inkey myself.key-in myself.cer
You need to enter a password and use the private key to use it.
The private key file myself.pfx was generated.
V. Open IIS Manager click Server Certificate
Click Import ...
Select myself.pfx File Enter the password entered at build time
Add Web site
Select HTTPS, use 443 port, and select the server certificate that you just imported.
This allows the HTTPS site to be completed, and the client with the Myself.cer certificate installed can be securely accessed.