2

I have an MVC 5 web application parts of which I need to run using SSL (lie login, account management etc). I enabled SSL for the web project, changed bindings in applicationhost.config:

<bindings>
    <binding protocol="http" bindingInformation="*:80:example.com" />
    <binding protocol="https" bindingInformation="*:443:example.com" />
</bindings>

But, when I restart IIS Express and run the site, it overwrites the SSL port to 44300. Any ideas to make it stay at 443?

Andrey
  • 20,487
  • 26
  • 108
  • 176

2 Answers2

2

1) netsh http show sslcert. In the output search for entry for port 44300 and copy certhash and appID.

2) Delete the entry for 44300: netsh http delete sslcert ipport=0.0.0.0:44300

3) Add a new entry for port 443 with certhash and appID copied in step 1. netsh http add sslcert ipport=0.0.0.0:443 certhash= appid=

After configuring the entry in http.sys, you need to restart http service for the changes to take effect.

net stop http

net start http

Deepak A S
  • 46
  • 3
  • I tried that, changed the cert to port 443 successfully (ran `etsh http show sslcert` to make sure port 443 shows up), then changed https binding to port 443. But when I open my web project in VS it forces the binding to change to 44300 again – Andrey Jan 31 '16 at 18:57
  • Ok, i also opened the csproj file, changed the port there and now it seems to work ok – Andrey Jan 31 '16 at 19:03
  • Great that you figured it out! – Deepak A S Jan 31 '16 at 19:10
0

Considering that you have mapped proper bindings. enable your application to use https in IIS by right click on webapplication virtual directory -> manage Application -> advance setting -> Enable Protocols

enter image description here

In FeaturedView pane click SSL Settings and check the box says Require SSL and click Apply.

enter image description here

You may also want to look at this existing post IIS Express defaulting to port 44300 for https when enabling SSL

Community
  • 1
  • 1
Rahul
  • 76,197
  • 13
  • 71
  • 125