I have some troubles with configuring requesting for client certificate to protect mvc area. I can easily configure this for whole application, but is it possible to do this only for one area (admin for example) ?
Asked
Active
Viewed 544 times
2 Answers
1
So, the easiest way to achieve this, is to create a folder named as your area and set required SSL settings on this folder using IIS Manager. Then you can delete this folder. IIS Manager will set required settings in applicationHost.config file. Or you can manually edit applicationHost.config.

Community
- 1
- 1

Pavel Kharibin
- 765
- 2
- 15
- 24
-
Thanks for the answer. I am able to resolve a big problem – ManishKumar Mar 30 '18 at 19:59
-2
You can add SSL requirements to specific controllers by adding [RequireHttps] at the top of the controller like so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net.Http;
using System.Dynamic;
namespace com.yourdomain.Controllers
{
[RequireHttps]
public class SomeController: Controller
{
//some logic here
}
}
In your case this would be something like your admin controller

JanR
- 6,052
- 3
- 23
- 30
-
Yes, I can. But this is not what I need. I need to make client browser to provide client certificate to access all controllers in area – Pavel Kharibin Jun 12 '13 at 03:18