信任来自IIS的自签名证书 [英] Trust a self signed cert from IIS

查看:999
本文介绍了信任来自IIS的自签名证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个外部托管的iis网络服务器,我运行我的网站。我想在本网站上添加一个自签名证书,并在我的本地客户端上信任它,从浏览器中删除不安全连接。

I have an externally hosted iis webserver where i run my website. I would like to add a self signed certificate to this website and trust it on my local client, to remove "Insecure Connection" from the browser.

我做了什么远是以下


  1. 在IIS中创建自签名证书:服务器证书 - >创建自签名证书。证书颁发给服务器名称,例如ABCD01

  2. 使用自签名证书创建一个带有https绑定的网站。

  3. 导出自签名来自IIS的证书使用:服务器证书 - >导出。这导致.pfx文件

  4. 在本地客户端上导入.pfx证书文件:管理计算机证书 - >受信任的根证书颁发机构 - >导入

  5. 将主机名(ABCD01)和主机IP添加到hosts文件中:C:\ Windows \ System32 \ drivers \ etc \ hosts

  1. Created a self signed certificate in IIS: Server Certificates -> Create self signed Certificate. The cert is issued to the servername e.g "ABCD01"
  2. Created a website with a https binding using the self signed certificate.
  3. Exported the self signed certificate from IIS using: Server Certificates -> Export. This resulted in an .pfx file
  4. Imported the .pfx cert file on the local client: manage computer certificates -> Trusted Root certification authorities -> import
  5. Added the hostname (ABCD01) and ip of the host to the hosts file: C:\Windows\System32\drivers\etc\hosts

当我尝试在firefox中打开网站时(使用 https:// ABCD01 ),我仍然得到你的连接不安全。我缺少什么?

When i try to open the website in firefox (using https://ABCD01), i still get the "Your connection is not secure". What am i missing?

推荐答案

有多个问题:


  1. IIS证书生成器使用SHA1签名算法创建自签名证书,该算法在现代浏览器中已过时。您必须使用不同的工具来创建测试证书。例如,使用PowerShell New-SelfSignedCertificate cmdlet,您可以在其中指定签名算法。请看这篇文章以获得一个例子: https://stackoverflow.com/a/45284368/3997611

  1. IIS certificate generator creates self-signed certificates with SHA1 signature algorithm which is obsolete in modern browsers. You have to use different tools to create test certificates. For example, use PowerShell New-SelfSignedCertificate cmdlet where you can specify signature algorithm. Look at this post to get an example: https://stackoverflow.com/a/45284368/3997611




New-SelfSignedCertificate `
    -DnsName "ABCD01" `
    -CertStoreLocation "cert:\LocalMachine\My" `
    -FriendlyName "test dev cert" `
    -TextExtension "2.5.29.37={text}1.3.6.1.5.5.7.3.1" `
    -KeyUsage DigitalSignature,KeyEncipherment,DataEncipherment `
    -Provider "Microsoft RSA SChannel Cryptographic Provider" `
    -HashAlgorithm "SHA256"




  1. IIS证书生成器无法构建具有SAN浏览器所需的SAN(使用者备用名称)证书扩展名的证书。您必须使用不同的工具来创建测试证书。请查看上面的示例以供参考。

  1. IIS certificate generator cannot build certificate with SAN (Subject Alternative Names) certificate extension which is required in Google Chrome. You have to use different tools to create test certificates. Look at the example above for reference.

Google Chrome使用内置Windows证书存储来建立信任,而FireFox使用自己的证书存储。因此,将证书添加到Windows证书存储区后,您必须手动将测试证书导入FireFox。

Google Chrome uses built-in Windows Certificate store to establish a trust, while FireFox uses its own certificate store. Therefore, after adding the certificate to Windows certificate store, you have to import your test certificate to FireFox manually.

这篇关于信任来自IIS的自签名证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆