Web.config error with Azure Emulator / IIS Express and SSL certificate authentication

Before anyone gets confused, this is for IIS Express , not for IIS.

We have an MVC5 application that requires SSL client certificate authentication. In development, this is done in Azure Emulator, in VS2013, which runs under administrator rights (for port 80/443).

When we launch the application inside VS2013 (F5), it launches it inside Azure Emulator, but immediately gives an HTTP error 500.19 - Internal server error with details

This configuration section cannot be used along this path. It happens when a section is locked at the parent level. Locking is done either by default (overrideModeDefault = "Deny") or explicitly specify the tag location with overrideMode = "Deny" or an outdated allowOverride = "false".

And the configuration source is our MVC5 web.config application, in the following line:

<security>
    <access sslFlags="SslNegotiateCert" />
</security>

Interesting that I already installed c:\users\<my_username>\Documents\IISExpress\Config\applicationhost.configfor

<section name="access" overrideModeDefault="Allow" />

There is little documentation on this, but all we can get from Google indicates that this should be enough for regular IIS Express. I suspect that starting IIS Express in the Azure Emulator + Admin privilege violates something but cannot diagnose it.

Does anyone have an idea how to make this work?

+2
1

, . , c:\users\<my_username>\Documents\IISExpress\Config\applicationhost.config, , , Azure Emulator, , IIS Express, .

, "" AppCmd.exe, :

  • Azure Cloud Service .

    • ServiceDefinition.csdef
    • ( <Webrole> ... </WebRole>
    <Startup>
    <Task commandLine="UnlockSslSettingsSection.cmd" executionContext="elevated" taskType="simple" />
    </Startup>
    
  • UnlockSslSettingsSection.cmd , ( , ).

    IF NOT DEFINED APPCMD SET APPCMD=%SystemRoot%\system32\inetsrv\AppCmd.exe 
    %APPCMD% unlock config /section:system.webServer/security/access
    
  • , UnlockSslSettingsSection.cmd = > properties = > " " " "

+4

Source: https://habr.com/ru/post/1616345/


All Articles