chr*_*ris 111 iis ssl-certificate windows-7
我已经完成了如何在localhost上使用https/SSL中详述的步骤?但这会为我的机器名设置一个自签名证书,当通过https:// localhost浏览时,我会收到IE警告.
有没有办法为"localhost"创建自签名证书以避免此警告?
Ben*_*ynn 72
虽然这篇文章的帖子是针对Windows标记的,但是OS X上的相关问题是我还没有看到其他地方的答案.以下是在OS X上为localhost创建自签名证书的步骤:
# Use 'localhost' for the 'Common name'
openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
# Add the cert to your keychain
open localhost.crt
Run Code Online (Sandbox Code Playgroud)
在Keychain Access
,双击这个新的localhost证书.展开"信任"旁边的箭头,然后选择"始终信任".Chrome和Safari现在应该信任此证书.例如,如果要将此证书与node.js一起使用:
var options = {
key: fs.readFileSync('/path/to/localhost.key').toString(),
cert: fs.readFileSync('/path/to/localhost.crt').toString(),
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
honorCipherOrder: true,
secureProtocol: 'TLSv1_2_method'
};
var server = require('https').createServer(options, app);
Run Code Online (Sandbox Code Playgroud)
Aur*_*deh 46
您可以使用PowerShell使用new-selfsignedcertificate cmdlet生成自签名证书:
New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\LocalMachine\My"
Run Code Online (Sandbox Code Playgroud)
注意:不推荐使用makecert.exe.
Cmdlet参考:https: //technet.microsoft.com/itpro/powershell/windows/pkiclient/new-selfsignedcertificate
小智 45
在这个问题上花了很多时间之后,我发现无论何时我都遵循使用IIS制作自签名证书的建议,我发现发布的和发布的不正确.SelfSSL.exe是解决此问题的关键.以下网站不仅提供了逐步制作自签名证书的方法,而且还解决了问题发布和发布问题.这是我发现自签名证书的最佳解决方案.如果您希望以视频形式查看相同的教程,请单击此处.
SelfSSL的示例用法如下所示:
SelfSSL /N:CN=YourWebsite.com/V:1000/S:2
SelfSSL /?将提供一个参数列表和解释.
Ogg*_*las 38
由于此问题已被标记,IIS
我无法找到关于如何获得可信证书的良好答案,我将给出2美分:
首先在PowerShell中使用@AuriRahimzadeh中的命令作为管理员:
New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\LocalMachine\My"
Run Code Online (Sandbox Code Playgroud)
这很好,但证书不受信任,将导致以下错误.这是因为它没有安装Trusted Root Certification Authorities
.
通过开始解决这个问题mmc.exe
.
然后去:
文件 - >添加或删除管理单元 - >证书 - >添加 - >计算机帐户 - >本地计算机
展开Personal
文件夹,您将看到您的localhost
证书:
将其复制到 Trusted Root Certification Authorities - Certificates
最后一步是打开Internet Information Services (IIS) Manager
或简单inetmgr.exe
.从那里转到您的网站,选择Bindings...
和Add...
或Edit...
.https
从下拉列表中设置并选择您的证书.
您的证书现在受信任:
Dav*_*ela 22
如果您正在尝试创建一个允许您继续使用的自签名证书,则可以使用http://localhost/mysite
此方法创建它
makecert -r -n "CN=localhost" -b 01/01/2000 -e 01/01/2099 -eku 1.3.6.1.5.5.7.3.1 -sv localhost.pvk localhost.cer
cert2spc localhost.cer localhost.spc
pvk2pfx -pvk localhost.pvk -spc localhost.spc -pfx localhost.pfx
Run Code Online (Sandbox Code Playgroud)
来自http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/32bc5a61-1f7b-4545-a514-a11652f11200
生成本地主机证书的最快方法。
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
Run Code Online (Sandbox Code Playgroud)
是和不是。自签名证书会导致该警告消息,因为该证书不是由受信任的证书颁发机构签名的。您可以考虑使用一些选项来删除本地计算机上的此警告。有关详细信息,请参阅此问题的排名最高的答案:
我需要做什么才能让 Internet Explorer 8 接受自签名证书?
希望这可以帮助!
编辑:
抱歉,我最初并没有意识到您被限制在本地主机上。您可以尝试按照以下链接中的说明“生成具有正确公用名的自签名证书”。
http://www.sslshopper.com/article-how-to-create-a-self-signed-certificate-in-iis-7.html
归档时间: |
|
查看次数: |
165961 次 |
最近记录: |