I wanted to require SSL for the Elmah controller in Elmah.MVC package. Has anybody already done this? As of now I can secure it by requiring authorization but I would want elmah log data returned only over SSL.
Asked
Active
Viewed 355 times
1 Answers
1
Open the ELMAH controller and add the following attribute:
[RequireHttps]
Example:
using System.Web.Mvc;
namespace Elmah.Mvc
{
[Authorize]
[RequireHttps]
public class ElmahController : Controller
{
public ActionResult Index(string resource)
{
/* Adapted by Alexander Beletsky */
return new ElmahResult();
}
public ActionResult Detail(string resource)
{
/* Adapted by Alexander Beletsky */
return new ElmahResult();
}
}
}
Source code for the ELMAH controller taken from GitHub project

Tommy
- 39,592
- 10
- 90
- 121
-
1yup, thanks, I was wondering if someone had extended ELMAH configuration to enable Https. – Sandeep Phadke May 03 '13 at 18:48
-
I don't think anyone has specifically done that, but glad this little fix worked out for you! – Tommy May 04 '13 at 02:23