After setting up HTTPS in IIS Express, according to such articles as this and this, I am unable to actually load an IIS Express site using HTTPS. I only get "This webpage is not available" (with error code "ERR_CONNECTION_RESET") in Chrome or "Internet Explorer cannot display the webpage" in IE when I follow the directions in those articles.

It appears this has to do with the fact that the "IIS Express Development Certificate" that IIS Express installs automatically has been removed. How do I get this certificate reinstalled?

share|improve this question
1  
Also happened to me trying to run IISExpress on port 443 (or actually on any port outside the 44300-44399 range) – Gerardo Grignoli Jul 12 '16 at 3:02
    
Note: the accepted answer to this question is applicable even where the IIS Express localhost certificate is present and appears to be fine. – haymansfield Aug 2 '16 at 8:37
    
For Visual Studio 2017 see stackoverflow.com/questions/44142037/… – RickAndMSFT Jul 19 at 15:22
up vote 142 down vote accepted

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!

share|improve this answer
2  
This worked for me – LamonteCristo Dec 11 '13 at 14:30
2  
Thanks. I used this method to regenerate a missing IIS express certificate (and I'm adding this comment in the hope that it will make google index this page with those as the search terms, as its what I used, but didn't get very far) – Sam Holder Jul 21 '14 at 19:14
1  
Works for me too, but in my case the certificate was there. Not sure why, but that resulted in same error. So i've removed certificate, and 'repair' reinstalled this back, and voila. Thanks alot. – Darius Sep 30 '14 at 8:14
1  
This should be marked as the answer – Tom McKearney Oct 9 '14 at 17:31
5  
Note for Windows 10 users: Repair is only in the Control Panel, not in the Add Remove programs app. Brilliant idea msft. – Chris Weber Apr 4 '16 at 0:51

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.

share|improve this answer
    
This worked for me trying to run IISExpress on port 443. +1 – Gerardo Grignoli Jul 12 '16 at 3:04
    
This was a lifesaver! Thank you!!! – ForOhFor Aug 15 '16 at 14:49
    
Thanks indeed, now I finally got my problem fixed. – MushyPeas Nov 27 '16 at 20:30
    
This solution worked great for me. Windows 10, Visual Studio 2015, IIS Express 10. – Glenn Mar 3 at 19:09
1  
In Windows 10, IIS Express has a repair option. You need to go through Control Panel. Accepted answer worked for me. – joerage Jun 1 at 15:11

Sometimes this error is because of a different certificate installed for localhost. If that is the case, there is no need to restore the IIS Express certificate. Instead, you can do the following to tell IIS Express to use your existing certificate:

  1. Open the Certificates MMC snap-in as described here
  2. Find your localhost certificate e.g. under Personal...Certicates and get its thumbprint:
    1. Bring up the properties dialog for the localhost certificate and find the Thumbprint property
    2. Paste the thumbprint value into Notepad (or whatever) and remove the spaces and any special characters at the beginning
  3. Find the port value of your IIS Express project:
    1. Go to the project properties in Visual Studio and finding the "SSL URL" value, e.g. "https://localhost:44300/MyApp".
    2. In this example 44300 is the port number. If yours is different, change that value in the later commands.
  4. Use the following commands in an administrative command prompt (not Powershell):

netsh http delete sslcert ipport=0.0.0.0:44300

netsh http add sslcert ipport=0.0.0.0:44300 certhash=your_cert_hash_with_no_spaces appid= {123a1111-2222-3333-4444-bbbbcccdddee}

The Guid in the above command can be replaced with one that you generate. It does not correspond to any existing IIS Express value.

For further reference see Handling URL Binding Failures in IIS Express.

share|improve this answer
    
A more visual way is to use Jexus Manager, blog.lextudio.com/… then you don't have to remember the details like certificate hash. – Lex Li Jun 15 at 4:14

Also note that for IIS Express to work with SSL, the port used needs to be in the 44300 through 44399 range (http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-without-administrative-privileges).

So, if you're using IIS Express in Visual Studio, make sure the port selected is in the required range: vs setting for iis express

share|improve this answer
    
Good point, indeed. I ran into this issue a few months ago. It was a pain sorting it out! – Chris Simmons Jun 30 '16 at 14:36
1  
I was able to use a port outside this range after using the command in Bernie White's answer without any problems. Windows 10 / Visual Studio Community 2015 / .Net Core 1.0.1 / IIS Express 10.0 – Ryan Thomas Oct 3 '16 at 2:17
1  
Thanks! This solved the issue for me. Weird that Visual Studio doesn't warn about that. – Erwin Mayer Nov 3 '16 at 4:12
    
Thanks, that was the answer! – Yuriy A. Feb 7 at 20:57
    
After messing with certificates, repairing IIS Express etc - tried this as a last ditch attempt - it only went and worked!! Good catch! Upvoted.. – Bertie May 18 at 22:13

With new Chrome 58, nothing from the answers below will help. I've just spent 1 hour uninstalling / reinstalling certificates and trying to find out where the problem is.

Apparently Chrome 58 will refuse certificate because "missing_subjectAltName"

The solution is either "badidea" passphrase or if you need to open popups for login you have to use :

chrome://flags/#allow-insecure-localhost

The source is and the upvote belongs to: https://stackoverflow.com/a/38926117/2089232 :)

share|improve this answer
2  
    
Also see blog.lextudio.com/… – Lex Li Jun 15 at 4:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.