Te7*_*e7a 4 c# iis configuration makecert windows-10
我使用的是 Windows 10。我没有 makecert.exe,当我尝试运行命令来生成证书时我才知道,就像
makecert.exe
我收到错误一样:
'makecert' 不是内部或外部命令,也不是可运行的程序或批处理文件。
我已经为 Windows 10 安装了 Windows SDK。
bee*_*r73 14
目前makecert已被弃用,使用 powershell ' New-SelfSignedCertificate '(作为管理员)的新方式,例如:
1.- We create a new root trusted cert:
$rootCert = New-SelfSignedCertificate -Subject 'CN=TestRootCA,O=TestRootCA,OU=TestRootCA' -KeyExportPolicy Exportable -KeyUsage CertSign,CRLSign,DigitalSignature -KeyLength 2048 -KeyUsageProperty All -KeyAlgorithm 'RSA' -HashAlgorithm 'SHA256' -Provider 'Microsoft Enhanced RSA and AES Cryptographic Provider'
2.- We create the cert from the root trusted cert chain:
New-SelfSignedCertificate -DnsName "localhost" -FriendlyName "MyCert" -CertStoreLocation "cert:\LocalMachine\My" -Signer $rootCert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1") -Provider "Microsoft Strong Cryptographic Provider" -HashAlgorithm "SHA256" -NotAfter (Get-Date).AddYears(10)
3.- We copy the thumbprint returned by the last command
4.- (If neccesary) We remove the last association ip/port/cert:
netsh http delete sslcert ipport=0.0.0.0:443
5.- We associate the new certificate with any ip and port 443 (the appid value does not matter, is any valid guid):
netsh http add sslcert ipport=0.0.0.0:443 appid='{214124cd-d05b-4309-9af9-9caa44b2b74a}' certhash=here_the_copied_thumbprint
6.- Now, you must open MMC (Certificates Local Computer) and drag and drop the 'TestRootCA' certificate from your 'Personal/Certificates' subfolder to 'Trusted Root Certification Authorities/Certificates' subfolder.
Run Code Online (Sandbox Code Playgroud)
这些命令还解决了 Google Chrome 稍后返回的错误ERR_CERT_WEAK_SIGNATURE_ALGORITHM,因为证书是使用 SHA1 而不是 SHA256 创建的
Dam*_*ver 11
它可能已安装,但可能只是不在路径中。
例如,我可以在下找到它,C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64但我也可以在 下找到另一个C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86。路径中的确切版本将根据您安装的 SDK 的确切版本而有所不同。
PATH尽管这些路径都不在我的环境变量中(我不记得在安装 SDK 后明确删除它),所以我不能只makecert在命令行说,我必须提供我想要的完整路径跑步。
尝试查找副本位置的一种方便方法是where命令。在这里,我将搜索限制在 SDKs 目录中,但您可以根据需要搜索整个硬盘:
C:\Users\Damien>where /R "C:\Program Files (x86)\Windows Kits" makecert.*
C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\arm64\makecert.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64\makecert.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86\makecert.exe
Run Code Online (Sandbox Code Playgroud)
如果您安装了 Fiddler,Fiddler 也会附带 makecert.exe。它位于
C:\Users\<yourwindowslogin>\AppData\Local\Programs\Fiddler\makecert.exe
Run Code Online (Sandbox Code Playgroud)
小智 5
这就是我安装 makecert.exe 文件的方式
(注意:我先安装了Windows 10 SDK,但是,这个版本没有在“bin”目录下安装makecert.exe。没问题!)
| 归档时间: |
|
| 查看次数: |
24892 次 |
| 最近记录: |