Den*_*ise 3 iis ssl ssl-certificate
是否可以在 IIS 中创建自签名 SAN ssl 证书?如果是这样,我该如何去创建它?在IIS中,我只看到创建普通ssl证书的选项:
不幸的是,IIS 管理器无法创建带有 SAN 扩展名的证书或请求。你必须使用别的东西。例如,PowerShell 或 certreq.exe 工具(两者都包含在框中)。
New-SelfsignedCertificate `
-DnsName "mysite.com","www.mysite.com" `
-CertStoreLocation cert:\localmachine\my
Run Code Online (Sandbox Code Playgroud)
New-SelfsignedCertificate -Subject "CN=www.mysite.com" `
-DnsName "mysite.com","www.mysite.com" `
-EKU "Server Authentication" `
-KeySpec "KeyExchange" `
-KeyUsage "DigitalSignature", "KeyEncipherment" `
-FriendlyName "My web site"
-NotAfter $([datetime]::now.AddYears(1)) `
-CertStoreLocation cert:\localmachine\my
Run Code Online (Sandbox Code Playgroud)
准备具有以下内容的 INF 模板文件(具有 .inf 文件扩展名):
[NewRequest]
Subject = "CN=www.mysite.com"
KeyLength = 2048
KeyAlgorithm = RSA
ProviderName = "Microsoft Enhanced RSA and AES Cryptographic Provider"
MachineKeySet = true
KeySpec = 1
KeyUsage = 0xa0
RequestType = Cert
[EnhancedKeyUsageExtension]
OID=1.3.6.1.5.5.7.3.1 ; server authentication
[Extensions]
2.5.29.17 = "{text}"
_continue_ = "dns=mysite.com&"
_continue_ = "dns=www.mysite.com"
Run Code Online (Sandbox Code Playgroud)
然后对这个 INF 文件执行以下命令:
certreq -new path\myinftemplate.inf
Run Code Online (Sandbox Code Playgroud)
什么版本的 Windows?如果是较新版本的 Windows,打开 powershell 并使用New-SelfSignedCertificate commandlet 可能会更容易。您可以使用 来-DnsName
提供 SAN 中所需的所有名称的列表。
归档时间: |
|
查看次数: |
9395 次 |
最近记录: |