How to Use HTTPS with Microsoft.AspNet.Server.WebListener

后端 未结 2 516
醉酒成梦
醉酒成梦 2021-01-19 09:28

At the end of this article http://www.asp.net/vnext/overview/aspnet-vnext/create-a-web-api-with-mvc-6 it describes how to host a MVC6 app in a Console app using Microsoft.As

2条回答
  •  一整个雨季
    2021-01-19 10:14

    For https, the only way I got it to work is adding the following entry into your project.json:

    "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=https://+:12345;
    

    Make sure to install the self signed or a commercially purchased public SSL certificate using:

    netsh http add sslcert
    

    command line tool or using a very nice GUI tool by Steve at http://www.stevestechspot.com/HttpConfigUpdate.aspx. Also, remember to give permissions using:

    netsh add urlacl url=http://+:12345 /yoururl user=Everyone
    

提交回复
热议问题