A dynamic RequireSsl Attribute for ASP.NET MVC - Rick Strahl's Web Log

added by Paul Wheeler
6/19/2014 1:44:25 PM

4 Kicks, 112 Views

In most of my Web applications I’m finding that I need to handle SSL activation dynamically rather than statically. IOW, depending on the environment that I’m running in I need to specify whether I want to enforce SSL or not. Specifically during development I typically want to run with SSL disabled and at runtime on my live server I want to force it on. For these reasons I like to use a configuration switch to turn SSL on and off at runtime based on a configuration setting.