Eric Brown - Cal
Eric Brown - Cal

Reputation: 14399

URL rewrite webconfig settings broke iisexpress

I was doing a merge for another devs app. vs2013 wvc web app ,net 4.5.2.

part of the merge was adding this to the config for url rewrite.

<system.webServer>
    
 
    <caching enabled ="false" />
    <rewrite>
      <rules>
        <rule name="HTTP to HTTPS Redirect" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>
    <modules>

I ran Vs2013 in iisexpress and now any time I run the app I get this error.

Error: This site can’t provide a secure connection localhost sent an invalid response. Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ERROR

I commented that block out of the config, it still does it. I load a different app, still does it I installed URL rewrite 2.1, still does it I reboot the machine still does it

If change the app from iisexpress to iis in the project web settings it works.

If I change it back to iisexpress.. breaks again.

It seems to me that the local instance of iisexpress got some thing set on it that's broken.

But if rebooting didn't fix it, how do I fix it so iisexpress works again?

UPdate, I added this to my config, and installed firefox, as somoen said it's a chrome issue that makes it stick like that.

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <security>
      <!--<access sslFlags="None" />-->
    </security>
    <caching enabled ="false" />
    <!--
    
    <rewrite>
      <rules>
        <rule name="HTTP to HTTPS Redirect" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>-->

And iisexpress works now in firefox.

Anyone know what Chrome is doing that 's causing the issue, I need to be able to test in chrome, alas.

Upvotes: 0

Views: 45

Answers (1)

Eric Brown - Cal
Eric Brown - Cal

Reputation: 14399

Okay, I figured it out.

Chrome was in some kind of half more secure mode where it always checked to see if a site was ssl,but did not set the settign that controls the behavior.

I added http:\localhost to the trusted site list,

then turned the flag on and then back off again that makes chrome check that a site is secure. After that everything worked again.

enter image description here

Upvotes: 0

Related Questions