2

I'm trying to test my website locally using SSL with IIS Express. It has the following properties set:

But whenever I open the https address, I get the following error:

In "Microsoft Edge":

enter image description here

In Google Chrome:

enter image description here

I've read article after articles, including some on SO but to no avail. I've tried the following:

Any help would be greatly appreciated.

Thanks.

Thierry
  • 6,142
  • 13
  • 66
  • 117

2 Answers2

2

I finally figured it out by following this article How to trust the IIS Express Self-Signed Certificate but a few additional steps:

  1. Export IIS Express Development certificate to a local from. This certificate can be found in the Server Certificates section in IIS 10.0.

  2. Open the Certificate console by calling mmc.exe certmgr.msc from File|Run.

  3. Delete all instances of localhost under the Trusted Root Certification Authorities|Certificates.

  4. Import the newly created certificate. You will get prompted with the following:

enter image description here

  1. Once imported, I went back to Asp.Net MVC 5 project, recompile it and ran it. When I ran it, I got prompted with the following:

enter image description here

This is when I knew I was on the right track as this was the first time I had ever seen this prompt! Click Yes, and now this prompt appears:

enter image description here

And click Yes on this prompt as well. Your project will then launch the relevant browser.

Go to the https address defined in your .net project, in my instance, https://localhost:44354/, and you will now see the padlock displayed in the address bar to indicate that it is a secure site:

enter image description here

Most of these answers were already available in different answers provided on SO but the points that were missing or that I missed were that I had to export my IIS Express Development certificate, delete all localhost entries (which I had done) and then re-import this certificate. Once done, .NET detects the change and you get prompted accordingly.

Anyway, I hope this will help others.

Thierry
  • 6,142
  • 13
  • 66
  • 117
0

Self signed certificates need to be trusted or browsers won't accept them. You can easily use Jexus Manager to configure that,

https://www.jexusmanager.com/en/latest/tutorials/self-signed.html#to-trust-self-signed-certificate

While if you prefer manually, you can import the certificates to the Trusted Root Certificate Authority store in Windows.

Learn more about SSL, certificates, stores and so on (Google each of them and learn them thoroughly), so that next time you really understand what is the culprit before trying so many irrelevant things.

Jexus Manager also has an SSLDiag feature to identify potential issues,

https://www.jexusmanager.com/en/latest/tutorials/ssl-diagnostics.html

But you need to know enough so as to interpret its output correctly.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • I don't want to install jexus on my dev machine for the time being and while it looks very interesting, I would prefer going about it the manual way. The IIS Express Development certificate is currently located Trusted Root Certification Authorities. Isn't that enough? Thanks – Thierry Oct 08 '17 at 05:36