• 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.

    Repair IIS Express

    The certificate is back:

    IIS Express Development Certificate

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

    Success!

     

    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.

  • 相关阅读:
    决定搬家
    Deklarit3.0的确不错,推荐一下。
    [Linux] 安装samba
    如何远程连接非默认端口SQL Server
    [c#] for和foreach
    svn linux客户端安装
    [c#] HttpContext.Cache和AppFabric的性能对比
    [ms sql server]计算今天是第几周
    ajax readyState的五种状态详解
    清空sql server日志
  • 原文地址:https://www.cnblogs.com/FH-cnblogs/p/9395135.html
Copyright © 2020-2023  润新知