6

According to .net guidance of TLS protocol programming, it suggests to config security via appcontext switch when your project targets on .net 4.6. This way works when add appcontext in app.config for console application. However, it doesn't work when add appconext switch in web.config for website project.

This is the config I add.

<runtime>
   <AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false;Switch.System.Net.DontEnableSystemDefaultTlsVersions=false"/>
</runtime>
Some programmer dude
  • 363,249
  • 31
  • 351
  • 550
raychen3
  • 211
  • 2
  • 7

1 Answers1

15

AppContext switches usage in web config file:

<appSettings>
    <add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSchUseStrongCrypto" value="false" />
    <add key="AppContext.SetSwitch:Switch.System.Net.DontEnableSystemDefaultTlsVersions" value="false" />
</appSettings>

https://github.com/dotnet/docs/issues/6675

Tom Aalbers
  • 3,630
  • 4
  • 21
  • 44
raychen3
  • 211
  • 2
  • 7