如何通过嵌入网页或PowerShell来解决ssl证书错误来运行Gist?

如何通过嵌入网页或PowerShell来解决ssl证书错误来运行Gist?

问题描述:

我正在使用IISExpress在Visual Studio 2013中开发一个网站,并已启用HTTPS通过Visual Studio创建证书。这在Chrome中运行时存在已知问题,如VS 2017: All new/existing HTTPS web sites give a certificate error in Chrome中所述。如何通过嵌入网页或PowerShell来解决ssl证书错误来运行Gist?

这里的解决方案使用这里的要点camieleggermont/UpdateIISExpressCertificate.ps1生成一个新的证书,并取代旧的证书。

我试过运行,但没有成功。

我试着将代码嵌入到我的页面中。我将此代码<script src="https://gist.github.com/camieleggermont/5b2971a96e80a658863106b21c479988.js"></script>放置在htmlhead标记中,如样式链接和meta标记。

运行时,我在页面的后台看到gist代码,但仍然出现证书错误。

我尝试将script标记放在页面上的其他位置,结果相同。

我该怎么做才能嵌入这个并让它运行?或者我如何将它作为PowerShell命令运行?

另外还有另一种解决方案来解决Chrome中的证书问题?

谢谢。

+1

您需要在您的计算机上运行在PowerShell中的脚本,不是嵌入到网站 –

+0

@Mathias R.杰森我怎么做? –

+0

我在https://stackoverflow.com/questions/43676993/how-do-i-change-my-iis-express-ssl-certificate-for-one-that-will-work-找到了证书问题的解决方案,在克里斯的回答中用-chrome?rq = 1。 –

这将是更容易使用Jexus经理(自由和开放源码)生成自签名的证书,

  • SHA256。
  • CN和SAN被设置为您想要的值。

因此,它符合Chrome的要求。您也可以将证书很容易地添加到其受信任的根,

https://blog.lextudio.com/why-chrome-says-iis-express-https-is-not-secure-and-how-to-resolve-that-d906a183f0

+0

谢谢Lex Li。我刚刚在Visual Studio社区帖子中看到了关于此主题的解决方案。我了解Jexus Manager是商业性的,必须购买。那是对的吗? –

+0

@DovMiller nope。它是免费且开源的。 –