IISExpress cannot find ssl page running localhost with Visual Studio 2017

Posted FH1004322

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IISExpress cannot find ssl page running localhost with Visual Studio 2017相关的知识,希望对你有一定的参考价值。

Got solution from this post. Had to delete all localhost certificates and repair IIS Express. Thanks @ShaTin

https://stackoverflow.com/a/22818853/853295

Make sure to remove any previous ‘localhost‘ certificates as those could conflict with the one generated by IIS Express. I had this same error (ERR_SSL_PROTOCOL_ERROR), and it took me many hours to finally figure it out after trying out many many "solutions". My mistake was that I had created my own ‘localhost‘ certificate and there were two of them. I had to delete both and have IIS Express recreate it.

Here is how you can check for and remove ‘localhost‘ certificate:

On Start, type -> mmc.exe, File -> Add/Remove Snap-in..., Select Certificates -> Add> -> Computer account -> Local computer, Check under Certificates > Personal > Certificates. Make sure the localhost certificate that exist has a friendly name "IIS Express Development Certificate". If not, delete it. Or if multiple, delete all. On Visual Studio, select project and under property tab, enable SSL=true. Save, Build and Run. IIS Express will generate a new ‘localhost‘ certificate.

Note: If it doesn‘t work, try these: make sure to disable IIS Express on VS project and stopping all running app on it prior to removing ‘localhost‘ certificate. Also, you can go to ‘control panel > programs‘ and Repair IIS Express.

 

After going to Add/Remove Programs and choosing the "Repair" option on IIS Express, the certificate has been reinstalled and I can now launch IIS Express sites using HTTPS.

技术分享图片

The certificate is back:

技术分享图片

And I can now launch the IIS Express site using HTTPS:

技术分享图片

 

For Visual Studio 2015, IIS Express 10, Windows 10, these options didn‘t work for me. IIS Express 10 didn‘t have a repair option.

I managed to solve the problem using the IisExpressAdminCmd.exe command available at C:Program Files (x86)IIS Express.

From an elevated command prompt run:

cd C:Program Files (x86)IIS Express
IisExpressAdminCmd.exe setupsslUrl -url:urlToYourSite -UseSelfSigned

Replacing urlToYourSite with your url.

e.g.

cd C:Program Files (x86)IIS Express
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:44387/ -UseSelfSigned

After that I closed IIS Express and restarted my site from Visual Studio and it prompted to automatically trust the self-signed certificate.

Hope that helps.

以上是关于IISExpress cannot find ssl page running localhost with Visual Studio 2017的主要内容,如果未能解决你的问题,请参考以下文章

在vs code中使用IIS Express插件启动出错 ‘We did not find a copy of IISExpress.exe at C:Program Files’

go 报错 cannot find module providing package或cannot find main module

eclipse故障cannot find -lstdc++,如何解决??麻烦高手详细讲解

/usr/bin/ld: cannot find -llzma /usr/bin/ld: cannot find -lbz2

Cannot find module '@babel/plugin-transform-react-jsx' 和Cannot find module '@babel/core&

Browser cannot find PAC because wpad hostname cannot be resolved